78

As the title says, would it be possible for eslint to show warnings instead of errors on ALL of the rules? I'm using Standard JS, if that information is relevant.

Thanks!

nrion
  • 4,258
  • 4
  • 17
  • 33

3 Answers3

58

I think there's no out-of-the-box option right now, but maybe you could use a plugin to achieve that: Eslint plugin only warn

Or set all the rules as warning instead of errors.

Wayrex
  • 2,027
  • 1
  • 14
  • 25
  • 2
    Unfortunately this seems to not work with the newest version of eslint (v6). It works well for v5, though. – Venryx Sep 12 '19 at 02:38
  • 9
    I can confirm it works with `eslint: 7.2.0`, when i tried. Thank the lord for these plugin makers. It fills me with immediate magma temperature RAGE! When in the middle of a complex bug and everything fails because there's a space at the end of the line or one of your imports has not yet been used. It grinds my gears!! :D – xam Oct 17 '20 at 08:56
  • 2
    The opposite plugin also exists: [eslint-plugin-only-error](https://github.com/davidjbradshaw/eslint-plugin-only-error). – Jan Aagaard Jul 16 '21 at 05:29
  • Works perfect with `7.32.0` – Reece Daniels Oct 03 '21 at 14:26
  • The only issue with eslint-plugin-only-warn is that actual errors like undefined variables appear as warnings, and it's not possible to change that – Jasperan Jan 28 '22 at 04:34
  • @Jasper it's possible to allow some errors with this fork: https://github.com/aminya/eslint-plugin-only-warn – Qtax Apr 28 '22 at 21:44
46

Following es-lint-plugin-prettier readme, edit your .eslintrc.json and put a specific rule for prettier:

"rules": {
  // maybe your other rules...

  "prettier/prettier": "warn"
}

Then, prettier rules will be issued as warnings instead of errors.

Not sure of all the side effects, but it seems to work ok for my project, where I also use @typescript-eslint/eslint-plugin, @typescript-eslint/parser, eslint-config-prettier and eslint-plugin-prettier.

If it helps, my extends config in .eslintrc.json:

"extends": [
  "eslint:recommended",
  "plugin:@typescript-eslint/eslint-recommended",
  "plugin:@typescript-eslint/recommended",
  "prettier/@typescript-eslint",
  "plugin:prettier/recommended"
],
Qortex
  • 7,087
  • 3
  • 42
  • 59
-2

You can create an .eslintrc file with all the rules set to "warn"

If you already have an eslintrc file you can use that, or extend from a rules file such as the one here. In this one, all the rules are set to 0 (disabled). You can modify specific ones or all of them and set them to 1 (or "warn")

Chetan Jadhav CD
  • 1,116
  • 8
  • 14