Skip to content

Update ESLint config #242

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

Merged

Conversation

friederbluemle
Copy link
Contributor

A couple of minor updates to the ESLint config:

  • Move rules into an overrides section, as these should only be applied to TypeScript files (.ts/.tsx)
  • Disable no-undef

The reason for disabling no-undef can be found in the official typescript-eslint docs:

We strongly recommend that you do not use the no-undef lint rule on TypeScript projects. The checks it provides are already provided by TypeScript without the need for configuration - TypeScript just does this significantly better.

Copy link
Member

@emin93 emin93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes, looks good.

@emin93 emin93 merged commit bb78a08 into react-native-community:main Jan 11, 2022
@friederbluemle friederbluemle deleted the update-eslint-config branch January 11, 2022 19:28
@mikehardy
Copy link
Contributor

mikehardy commented Jan 12, 2022

Strange, I would have thought these came in from the community eslint defs, I was just in this area for a different template and there's lots of duplication here (not saying what's best, just that it is)

https://github.com/facebook/react-native/pull/32655/files
https://github.com/facebook/react-native/pull/32644/files

and looks like I should do noshadow on the other template too :)

@friederbluemle
Copy link
Contributor Author

Sure, if these rules already come in from the community eslint config, then of course we should avoid the duplication here. In that case we probably also don't need #238 and we can revert both PRs. I remember in one project I worked on recently, I did need these overrides here, but maybe it was referencing an older version of eslint-config-react-native-community (?) @mikehardy Can you please confirm?

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

Successfully merging this pull request may close these issues.

3 participants