-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Configuration for rule "import/no-cycle" is invalid #2331
Configuration for rule "import/no-cycle" is invalid #2331
Comments
I have the same issue. Replacing When comparing version
|
so update your It works for me. |
Run |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There appears to have been a breaking change in a minor ESLing version. Updating this dependency should fix the issue. airbnb/javascript#2331 Signed-off-by: Darian Plumb <dplumb@bitwise.io>
There appears to have been a breaking change in a minor ESLing version. Updating this dependency should fix the issue. airbnb/javascript#2331 Signed-off-by: Darian Plumb <dplumb@bitwise.io>
Breaking change occurred in a minor ESLint version. Update to this dependency fixes the bug. Issue: airbnb/javascript#2331 Signed-off-by: Shannyn Telander <telander@bitwise.io>
Breaking change occurred in a minor ESLint version. Update to this dependency fixes the bug. Issue: airbnb/javascript#2331 Signed-off-by: Shannyn Telander <telander@bitwise.io>
This solves the github actions linter error by changing the eslint-plugin-import version as described in airbnb/javascript/issues/2331
Update this version to avoid "import-nocycle" [issue](airbnb/javascript#2331)
Why: need 2.22.1 minimum, to address issue with import/no-cycles rule in eslint. Was encountered while working on openedx/frontend-enterprise#21 Ref: airbnb/javascript#2331 (comment)
I have this problem too, but I have "eslint-plugin-import" updated to "2.22.1". |
I also still have this problem with "eslint-plugin-import" updated to "2.22.1". |
Try to remove node_modules and install it from scratch. |
- Found a stray comment for debug, removed - Found ESLint issue with AirBnB config -- See airbnb/javascript#2331 Attempting to fix by manualling adding rule
* fix: configuration for rule "import/no-cycle" is invalid airbnb/javascript#2331 (comment) * feat: support custom image
I have just encountered this issue today as well. I have
Here's my
I should also note that I arrived at this non-functional configuration by running
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. |
@KenSkudderPWW i'm really not sure; if all those are installed, then this message shouldn't be possible. |
Haha agreed on all fronts: I too am really not sure, and I too don't see how this message could be possible. For the thing I'm working on I think it'll be alright if I drop enforcement of code style rules, so I've done that in order to get around this, so I'm no longer stuck because of this personally. This issue and a Stack Overflow question which referenced it were the top google results for this problem so I just wanted to post my experience in case anyone else lands here likewise still experiencing the issue. |
This resolves the following error that occurs when running `yarn run lint` ``` yarn run fmt ... Oops! Something went wrong! :( ESLint: 7.20.0 Error: .eslintrc.js » eslint-config-airbnb-base » /home/steven/workspace/pools.piedao.org/node_modules/eslint-config-airbnb-base/rules/imports.js: Configuration for rule "import/no-cycle" is invalid: Value "∞" should be integer. ``` Grabbed from here: airbnb/javascript#2331 (comment)
I get this with repos:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v7.21.0'
hooks:
- id: eslint
additional_dependencies:
- eslint@7.21.0
- eslint-config-airbnb-base@14.2.1
- eslint-plugin-import@2.22.1 And confirming that only the correct version of the eslint-plugin-import is installed: $ cd ~/.cache/pre-commit/repou5udo74e/
$ rg --no-ignore 'maximum dependency depth to traverse'
node_env-system/lib/node_modules/eslint-plugin-import/lib/rules/no-cycle.js
20: description: 'maximum dependency depth to traverse',
$ cat node_env-system/lib/node_modules/eslint-plugin-import/lib/rules/no-cycle.js
...
module.exports = {
meta: {
type: 'suggestion',
docs: { url: (0, _docsUrl2.default)('no-cycle') },
schema: [(0, _moduleVisitor.makeOptionsSchema)({
maxDepth: {
oneOf: [
{
description: 'maximum dependency depth to traverse',
type: 'integer',
minimum: 1 },
{
enum: ['∞'],
type: 'string' }] },
... Somehow the schema ends up being this? How? {
"type": "array",
"minItems": 0,
"maxItems": 1,
"items": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"commonjs": {"type": "boolean"},
"amd": {"type": "boolean"},
"esmodule": {"type": "boolean"},
"ignore": {
"type": "array",
"minItems": 1,
"items": {"type": "string"},
"uniqueItems": true
},
"maxDepth": {
"description": "maximum dependency depth to traverse",
"type": "integer",
"minimum": 1
}
}
}
]
} |
Commit hooks can sometimes use global installs and not local ones; what happens with an actual local |
Well, it’s the opposite, somehow it uses the version installed in the project instead of the one in the pre-commit cache directory. Making both match circumvents the problem but it should really try importing locally first as opposed to where the config happens to be. |
That's part of the way node and npm and eslint all work, and not something this project can change. I'm not sure why there is a "pre-commit cache directory"; pre-commit hooks should be using the locally installed node_modules only. |
“locally”? That could mean anything. I stepped into the code. It prefers the |
locally means only one thing: in |
I had the same problems, even after checking peer dependencies and updating accordingly. |
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! |
Sadly i believe react-scripts fails to properly use ^ semver ranges, and so is unable to automatically receive bugfixes and security updates. |
I have updated eslint-plugin-import to version 2.22.1. |
Breaking change occurred in a minor ESLint version. Update to this dependency fixes the bug. Issue: airbnb/javascript#2331 Signed-off-by: Shannyn Telander <telander@bitwise.io>
This worked for me. Earlier face the issue of eslint version but later following the above steps, it got resolved. Thanks :) |
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.
This has started occurring from today only. It was working last week.
The text was updated successfully, but these errors were encountered: