eslint-config-react-native-community package need to update
See original GitHub issueDescription
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® Core™ 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.1
andeslint@7.32.0
.
yarn add @react-native-community/eslint-config@3.0.1 eslint@7.32.0 -D
- extends
@react-native-community
in 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
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top GitHub Comments
Just published 👍
Temporary fix in your package.json (if you are using Yarn):
to force
@react-native-community/eslint-config
to use5.15.0
typescript eslint parser.