question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

eslint-config-react-native-community package need to update

See original GitHub issue

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® 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

  1. install @react-native-community/eslint-config@3.0.1 and eslint@7.32.0.
yarn add @react-native-community/eslint-config@3.0.1 eslint@7.32.0 -D
  1. extends @react-native-community in your eslint config file.
// .eslintrc.js
module.exports = {
  extends: '@react-native-community',
}
  1. 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:closed
  • Created a year ago
  • Reactions:3
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
cortinicocommented, May 12, 2022

Just missing npm publish

Just published 👍

3reactions
Aure77commented, Apr 20, 2022

Temporary fix in your package.json (if you are using Yarn):

  "resolutions": {
    "@typescript-eslint/eslint-plugin": "5.15.0",
    "@typescript-eslint/parser": "5.15.0"
  },

to force @react-native-community/eslint-config to use 5.15.0 typescript eslint parser.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-community/eslint-config
ESLint config for React Native. Latest version: 3.2.0, last published: 2 months ago. Start using @react-native-community/eslint-config in ...
Read more >
react-native-community/eslint-config - npm package
The npm package @react-native-community/eslint-config was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was ...
Read more >
Adding and Updating Packages | Cumulus Linux 4.3
Updating, upgrading, and installing packages with apt causes disruptions to network services: Upgrading a package might result in services being restarted ...
Read more >
How to update each dependency in package.json to the ...
Quick and easy way to explicitly update a single package to the latest version without installing any new modules. I like npm-check-updates, but...
Read more >
eslint settings react version detect
... eslint-config-react-app npm · eslint package json configuration · add eslint to react project · eslint config · eslint config react native community...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found