javascript: Configuration for rule "import/no-cycle" is invalid
Oops! Something went wrong! 😦
ESLint: 7.0.0
Error: .eslintrc » eslint-config-airbnb » /node_modules/eslint-config-airbnb-base/index.js » /node_modules/eslint-config-airbnb-base/rules/imports.js: Configuration for rule “import/no-cycle” is invalid: Value “∞” should be integer.
My package json devDependency.
"@babel/core": "7.9.6",
"@babel/runtime": "7.9.6",
"@react-native-community/eslint-config": "0.0.5",
"@testing-library/jest-native": "3.1.0",
"@testing-library/react-native": "5.0.3",
"babel-eslint": "10.1.0",
"babel-jest": "24.8.0",
"babel-plugin-inline-import": "3.0.0",
"eslint": "7.0.0",
"eslint-config-airbnb": "18.1.0",
"eslint-config-prettier": "6.10.0",
"eslint-import-resolver-react-native": "0.2.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-react": "7.19.0",
This has started occurring from today only. It was working last week.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 37
- Comments: 23
Commits related to this issue
- Update eslint import plugin dependency There appears to have been a breaking change in a minor ESLing version. Updating this dependency should fix the issue. https://github.com/airbnb/javascript/iss... — committed to Cargill/grid by dplumb94 4 years ago
- Update eslint import plugin dependency There appears to have been a breaking change in a minor ESLing version. Updating this dependency should fix the issue. https://github.com/airbnb/javascript/iss... — committed to Cargill/grid by dplumb94 4 years ago
- Update eslint import plugin dependency Breaking change occurred in a minor ESLint version. Update to this dependency fixes the bug. Issue: airbnb/javascript#2331 Signed-off-by: Shannyn Telander <te... — committed to shannynalayna/splinter-ui by shannynalayna 4 years ago
- Update eslint import plugin dependency Breaking change occurred in a minor ESLint version. Update to this dependency fixes the bug. Issue: https://github.com/airbnb/javascript/issues/2331 Signed-of... — committed to shannynalayna/splinter-ui by shannynalayna 4 years ago
- Solution for linter error: inf symbol not valid This solves the github actions linter error by changing the eslint-plugin-import version as described in airbnb/javascript/issues/2331 — committed to keshav-c/React-Calculator by keshav-c 4 years ago
- Update eslint plugin import linter version Update this version to avoid "import-nocycle" [issue](https://github.com/airbnb/javascript/issues/2331) — committed to bertil291utn/linters-config by bertil291utn 4 years ago
- What: update eslint-plugin-import Why: need 2.22.1 minimum, to address issue with import/no-cycles rule in eslint. Was encountered while working on https://github.com/edx... — committed to openedx/frontend-build by binodpant 4 years ago
- Added extends for TL & JSDOM ESLint - Found a stray comment for debug, removed - Found ESLint issue with AirBnB config -- See https://github.com/airbnb/javascript/issues/2331 Attempting to fix by manu... — committed to merodiro/react-i18next by JacobMGEvans 4 years ago
- feat: support custom image (#54) * fix: configuration for rule "import/no-cycle" is invalid https://github.com/airbnb/javascript/issues/2331#issuecomment-724114465 * feat: support custom image — committed to game-ci/unity-request-activation-file by mob-sakai 3 years ago
- update eslint deps to resolve "∞" error This resolves the following error that occurs when running `yarn run lint` ``` yarn run fmt ... Oops! Something went wrong! :( ESLint: 7.20.0 Error: .eslint... — committed to stvnjacobs/pools.piedao.org by stvnjacobs 3 years ago
- Update eslint import plugin dependency Breaking change occurred in a minor ESLint version. Update to this dependency fixes the bug. Issue: https://github.com/airbnb/javascript/issues/2331 Signed-of... — committed to ameliabradley/grid by shannynalayna 4 years ago
eslint-config-airbnb-base
has aso update your
eslint-plugin-import
to^2.22.1
version, which supports “∞” symbol.It works for me.
I have the same issue.
Replacing
∞
withInfinity
works like version14.2.0
When comparing version
14.2.1
with14.2.0
https://github.com/airbnb/javascript/compare/eslint-config-airbnb-base-v14.2.0...eslint-config-airbnb-base-v14.2.1Try to remove node_modules and install it from scratch. Also run
npm ls
, to check your peer dep versions.I had the same problems, even after checking peer dependencies and updating accordingly. After tearing my hair for an hour, deleting node_modules and installing again, checking the actual code in the node_modules and adding debugging, I decided to restart VS Code. And the error message was gone. Lesson learned… I hope this can help at least someone else.
Run
npm ls
- if your peer dep versions are wrong, your dep graph is invalid, and nothing can be expected to work. Specifically, ensure your eslint plugins are updated (and nothing in your package.json should lack a ^, pinning is achieved with a lockfile, not with package.json)I also still have this problem with “eslint-plugin-import” updated to “2.22.1”.
I have this problem too, but I have “eslint-plugin-import” updated to “2.22.1”.
I have updated eslint-plugin-import to version 2.22.1. Then removed node_modules -
rm -rf ./node_modules
Then installed them -npm i
It worked for me. Thank you!I had the same issue, but was only seeing the error in Netlify’s pipeline build, not locally. It turns out that react scripts 3.4.1 uses the problematic version of eslint-plugin-import.
In order to fix this issue, I had to upgrade major versions, to react-scripts version 4 (along with major version upgrades to several other packages, including jest and eslint), to accommodate the major version bump. Hope that helps somebody!
I have just encountered this issue today as well. I have
eslint-plugin-import
updated to2.22.1
as well. Here’s mypackage.json
file:Here’s my
.eslintrc.json
file:I should also note that I arrived at this non-functional configuration by running
yarn run eslint --init
and making the following selections:When eslint prompted me about whether I wanted to install the peer dependencies required by my configuration via npm, I selected “no” (because my project uses yarn to manage dependencies) and installed them myself as dev dependencies with yarn.
yarn run eslint --version
gives mev7.20.0
in case that’s helpful.Thanks, @ljharb, for that background, and my apologies to the
eslint-config-airbnb-base
people for falsely blaming them.I send no compliments to the people who made a breaking change in a minor release of ESLint 😃