-
Notifications
You must be signed in to change notification settings - Fork 100
Invalid configuration for rule "@typescript-eslint/indent" #98
Comments
Strangely, not even settings rules:
"@typescript-eslint/indent":
- off
- 2
- {} in my //'@typescript-eslint/indent': baseStyleRules.indent, |
Got this error as well. |
Hey @AdrienLemaire and @sannysoft Sorry, I'm not sure how to replicate this problem. Is it easy to set this up from scratch? Would appreciate any additional details. Cheers! |
I was getting this issue and found that it does not happen when I run When it's not installed in node_modules, and npx d/ls and runs it from a temporary npx location e.g. /home/user/_npx/... I do get this issue. Hope this helps |
Same here, while bumping Eslint 6.8.0 to 7.2.0 Using eslint-config-airbnb-typescript 7.2.1 and 8.0.2 |
Same issue, observed after running eslint-config-prettier CLI tool |
This might be caused by updating to ESLint v7, which was not supported. v9.0.0 of this library has just been released, and includes support for ESLint v7. Hopefully this fixes the issue. |
Still getting this error when using v9.0.0 of this library |
Still getting the same issue with version 9.0.0
|
@iamturns would you be willing to put out a quick version that comments out the Else we're in a pretty bad position with options of having to manually comment it out for many developers each time we run yarn, downgrade, or abandon this package. |
Also experiencing this, and I looks like the root cause is multiple versions of Like airbnb, I encapsulate configs in a package (say
when eslint resolves the plugins by name, it uses the one at the root of node_modules, which is 2.34.0, and the error shows. In a different repo without the additional older version as a sub dep of one of the deps, v9.0.0 works without the indent config error. This can possibly be resolved by using full paths ( I was able to solve it, quite hackishly, using yarn resolutions, in the root package.json of the repo.
and this will also work if I add it as a local dependency. EDIT: I hit this again in a different project, and the solution was to install |
Still having this using globally installed eslint with typescript-eslint and airbnb-typescript:
|
Still having this using globally installed eslint with typescript-eslint and airbnb-typescript:
Also for reference using yarn 2 Does anyone have any clue how to solve it, thanks |
For a temporary fix to this problem use the following package versions.
|
I tried multiple versions. The latest for all those libraries to this day, as well as some of the suggested combinations. |
just faced the same issue (one and a half year later) on a project I have to maintain, running on a linux-based (ubuntu-latest) vsts-worker, using lerna, when I initially enabled eslint with latest packages: Error: .eslintrc.js » eslint-config-airbnb-typescript/base » /home/vsts/work/1/s/packages/util-health-check/node_modules/eslint-config-airbnb-typescript/lib/shared.js:
Configuration for rule "@typescript-eslint/indent" is invalid:
Value {"SwitchCase":1,"VariableDeclarator":1,"outerIIFEBody":1,"FunctionDeclaration":{"parameters":1,"body":1},"FunctionExpression":{"parameters":1,"body":1},"CallExpression":{"arguments":1},"ArrayExpression":1,"ObjectExpression":1,"ImportDeclaration":1,"flatTernaryExpressions":false,"ignoredNodes":["JSXElement","JSXElement > *","JSXAttribute","JSXIdentifier","JSXNamespacedName","JSXMemberExpression","JSXSpreadAttribute","JSXExpressionContainer","JSXOpeningElement","JSXClosingElement","JSXFragment","JSXOpeningFragment","JSXClosingFragment","JSXText","JSXEmptyExpression","JSXSpreadChild"],"ignoreComments":false,"offsetTernaryExpressions":false} should NOT have additional properties.
at ConfigValidator.validateRuleOptions (/home/vsts/work/1/s/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2027:23)
at /home/vsts/work/1/s/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2082:18
at Array.forEach (<anonymous>)
at ConfigValidator.validateRules (/home/vsts/work/1/s/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2079:34)
at ConfigValidator.validateConfigArray (/home/vsts/work/1/s/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2205:18)
at CascadingConfigArrayFactory._finalizeConfigArray (/home/vsts/work/1/s/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3962:23)
at CascadingConfigArrayFactory.getConfigArrayForFile (/home/vsts/work/1/s/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3768:21)
at FileEnumerator._iterateFilesRecursive (/home/vsts/work/1/s/packages/util-health-check/node_modules/eslint/lib/cli-engine/file-enumerator.js:448:49)
at _iterateFilesRecursive.next (<anonymous>)
at FileEnumerator.iterateFiles (/home/vsts/work/1/s/packages/util-health-check/node_modules/eslint/lib/cli-engine/file-enumerator.js:299:49) package.json: ...
"scripts": {
"build": "tsc",
"test": "jest --coverage",
"test:watch": "jest --watch",
"lint": "npx eslint src --ext .ts",
"lint:fix": "npx eslint src --ext .ts --fix"
},
"devDependencies": {
"@types/jest": "^29.2.4",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^8.30.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "^2.22.1",
"jest": "^29.3.1",
"jest-junit": "^15.0.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.9.4"
}
... .eslintrc.js module.exports = {
"env": {
"browser": false,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},
"extends": [
'airbnb-base',
'airbnb-typescript/base'
],
"plugins": [
"@typescript-eslint"
],
"rules": {
"max-len": ["error", { "code": 250 }]
},
"ignorePatterns": [
".eslintrc.js"
]
}; When running the same command on WSL2 for Windows, everything works as expected, though. Am I missing sth? |
Getting an error with this plugin which breaks my vim eslint plugin integration:
Using eslint-config-airbnb-typescript 7.2.1
The text was updated successfully, but these errors were encountered: