Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint #167

Open
coryhouse opened this issue Mar 18, 2023 · 0 comments
Open

ESLint #167

coryhouse opened this issue Mar 18, 2023 · 0 comments

Comments

@coryhouse
Copy link
Owner

coryhouse commented Mar 18, 2023

Configs

  • eslint-config-airbnb
  • eslint-config-airbnb-typescript
  • eslint-config-prettier
  • eslint-config-react-app
  • eslint-config-turbo

Plugins

Strongly typed env wrapper with ESLint rule to enforce using it: https://twitter.com/housecor/status/1648346461455675392. Or, perhaps don't wrap at all and just strongly type: https://www.youtube.com/watch?v=q1im-hMlKhM

Set --report-unused-disabled-directives when running the CLI to catch needless disables.

Use import/no-default-export to catch default exports. Disable this rule for React components like this:

  overrides: [
    {
      files: ["src/**/*.tsx"],
      rules: {
        "import/no-default-export": "off",
      }
    },
]

React

TypeScript

https://typescript-eslint.io/
https://typescript-eslint.io/rules/no-unnecessary-condition/ - My tweet thread
https://www.npmjs.com/package/eslint-plugin-no-type-assertion
https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-non-null-assertion.md

Fav rules from above:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant