Dave Edelhart
Dave Edelhart

Reputation: 1101

How do you disable indent checking on esLint?

The indent rule seems impossible to disable; how (in config settings) do I disable this rule? thanks.

Upvotes: 68

Views: 45208

Answers (7)

Fed
Fed

Reputation: 1885

In my webstorm project I had to put the following in my .eslintrc.js (I think this would work the same for .eslintrc or .eslintrc.json):

rules: {
    // other rule,
    // other rule,
    '@typescript-eslint/indent': 'off',    <---- add this rule
    // other rule
  }

Upvotes: 1

Squareman88
Squareman88

Reputation: 261

If you disable indent checking, remember to restart local server to get rid off the errors.

Upvotes: 0

Krishnamoorthy Acharya
Krishnamoorthy Acharya

Reputation: 4254

For typescript, we can utilize the following on the individual file at the top of the page which will disable eslint check for indent

/* eslint-disable @typescript-eslint/indent */

Upvotes: 0

Gianluca Casati
Gianluca Casati

Reputation: 3751

For indentation, I usually let it activated in config and disable it only in some files where I need a fancy indentation, hence I use the comment

/* eslint-disable indent */

It is worth to note that this works also with standardJS as well as on any other linter powered by eslint.

Upvotes: 27

Alex DS
Alex DS

Reputation: 101

This is the one that worked for me

"indent": ["error", ""],

Upvotes: 3

Saahithyan Vigneswaran
Saahithyan Vigneswaran

Reputation: 7143

I had to add more rules. To turn off linting for react and jsx-indent

"rules": {
    "indent": "off",
    "react/jsx-indent": "off",
    "react/jsx-indent-props": "off"
}

Upvotes: 18

Vincent Orback
Vincent Orback

Reputation: 2397

Set the rule to "off" in your config like this:

"rules": {
  "indent": "off"
}

You can read more in the docs here.

Upvotes: 90

Related Questions