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.

Invalid configuration for rule "@typescript-eslint/indent"

See original GitHub issue

Getting an error with this plugin which breaks my vim eslint plugin integration:

[Error  - 1:08:39 PM] .eslintrc.yml » eslint-config-airbnb-typescript » 
/home/dori/Projects/Work/project-v3/client/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. 

Using eslint-config-airbnb-typescript 7.2.1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:16
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

12reactions
eladocommented, Aug 5, 2020

Also experiencing this, and I looks like the root cause is multiple versions of @typescript-eslint/eslint-plugin in the hierarchy of node_modules, and eslint resolving to root node_modules packages that may be in different versions than the expectation.

Like airbnb, I encapsulate configs in a package (say @company/config-eslint), the package has a dep on @typescript-eslint/eslint-plugin@3.7.1, but when this package is installed elsewhere with another dep that has an older version, yarn installs both, and the newer is nested under node_modules/@company/config-eslint/node_modules:

# node_modules

@typescript-eslint/eslint-plugin@2.34.0 <-- too old
@typescript-eslint/parser@3.7.1
@company/config-eslint/node_modules/@typescript-eslint/eslint-plugin@3.7.1 <-- the new one is nested

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 (require.resolve) in the eslint config, instead of plugin names. A support for this is coming to eslint. See: https://github.com/eslint/rfcs/pull/14 / https://github.com/eslint/rfcs/pull/9

I was able to solve it, quite hackishly, using yarn resolutions, in the root package.json of the repo.

  "resolutions": {
    "@typescript-eslint/eslint-plugin": "^3.7.1"
  }

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 eslint at the root.

5reactions
kael89commented, Jul 23, 2020

Still getting this error when using v9.0.0 of this library

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint indent and @typescript-eslint/indent conflict
I want to set tab width to 4, but it seems the base eslint and the typescript eslint are in conflict. Any idea...
Read more >
indent | typescript-eslint
This rule extends the base eslint/indent rule. It adds support for TypeScript nodes. How to Use​ .eslintrc.cjs. module.
Read more >
indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Importing 'indent' rule from ESLint configuration should ...
Importing 'indent' rule from ESLint configuration should disable conflicting settings. · Function declaration parameters -> Align when Multiline (enabled by ...
Read more >
How to fix Definition for rule typescript-eslint no-use-before ...
I am new to eslint and I cannot figure out how to solve this issue. The beginning of my imports ... idea how...
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