Repository navigation
Description
Description
Problem
There are many no-shadow and no-undef lint errors while using @react-native-community/eslint-config@3.0.1.
Description
@react-native-community/eslint-config@3.0.1 has updated @typescript-eslint/parser to 4.33.0. And there are some behaviors have been changed since @typescript-eslint/parser@4.0.0, so @react-native-community/eslint-config need to update.
For example. no-undef is recommended to be off after @typescript-eslint/parser@4.0.0, but this rule in @react-native-community/eslint-config@3.0.1 is missing.
And I notice that these new rules are actually existed in current file already. So I think the problem will be resolved if you just publish a new version that includes the new rules.
Version
0.63.3
Output of npx react-native info
System:
OS: macOS 11.3.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1.55 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.3 - ~/.nvm/versions/node/v14.17.3/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.3/bin/npm
Watchman: 2021.06.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: Not Found
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
- install
@react-native-community/eslint-config@3.0.1andeslint@7.32.0.
yarn add @react-native-community/eslint-config@3.0.1 eslint@7.32.0 -D- extends
@react-native-communityin your eslint config file.
// .eslintrc.js
module.exports = {
extends: '@react-native-community',
}- run lint script.
eslint -c --ext .js,.ts,.tsx src/Snack, code example, screenshot, or link to a repository
Code
export interface Props {
children: React.ReactElement;
}Error
11:34 error 'React' is not defined no-undef
Activity
alxmiron commentedon Apr 14, 2022
Please push
@react-native-community/eslint-config@3.0.2to npm, because it has updates of@typescript-eslint/eslint-plugin ^5.15.0and@typescript-eslint/parser ^5.15.0, that allows using of TS v4.5 type import modifiers.Now it throws an error:

Aure77 commentedon Apr 20, 2022
Temporary fix in your package.json (if you are using Yarn):
to force
@react-native-community/eslint-configto use5.15.0typescript eslint parser.sseppola commentedon Apr 22, 2022
Looks like the necessary changes have already been merged: #32800
Just missing npm publish
Edit: Another merged PR that fixes this issue: #33448
It also solves the flowtype error that occurs after applying @Aure77's fix.
ginnymin commentedon May 12, 2022
Any updates on this?
cortinico commentedon May 12, 2022
Just published 👍
SohelIslamImran commentedon May 18, 2022
@cortinico Why still 7?
https://github.com/facebook/react-native/blob/763dc5238721a21847b6d6670b5fa268e3bf2ed4/packages/eslint-config-react-native-community/package.json#L28
wwdrew commentedon Jul 25, 2022
@cortinico Hi, a new commit (f3db6cc) has landed that updates this package to work with ESLint 8. Would it be possible to publish a new release of this package?
I was going to submit a separate PR to upgrade the version of this package used in the template, but thought it might be more worthwhile to wait until the ESLint 8 support has been finalised first.
cortinico commentedon Jul 29, 2022
Doing it here:
cortinico commentedon Aug 1, 2022
Just pulished on NPM 👍
wwdrew commentedon Aug 1, 2022
Thanks so much @cortinico! I'm just testing it now with ESLint 8 and so far all looking great. If all goes well, I'll submit a PR to update the dependencies in the template.