0

With eslint I've my max line length on 80 and I like this besides for one file where I'd like to organize my exports ASC and the only way to do this with my VS Code plugin is that I have each export on one line.

Default my max line length is 80, how can I make an exception for this one file? Is there an eslint comment for this?

Alexander
  • 396
  • 1
  • 9
  • 19

1 Answers1

0

With a comment: Put /* eslint-disable max-len */ at the top of your file (src: https://eslint.org/docs/latest/use/configure/rules#disabling-rules).

Alternatively, define overrides for some rules for specific file patterns in your .eslintrc file:

"overrides": [
  {
    "files": ["path/to/your/very/long/*/files.js"],
    "rules": {
      "max-len": ["off"]
    }
  }
]

(src: Turning off eslint rule for a specific file)

I would have marked this question as an exact dupe of Turning off eslint rule for a specific file, but bountied questions cannot be marked as dupe.

Related: How to disable eslint rule max line length for paragraph in <template> of vue.js?

knittl
  • 246,190
  • 53
  • 318
  • 364