I'm coding with brackets and I have eslint installed. Eslint keeps telling me that some functions and var's are defined but never used. I think it is because I'm using an external js file which I linked to my html document. My question is how can I disable this error, or tell eslint to not inform me of this error?
Asked
Active
Viewed 1,279 times
1
-
Is there "an .eslintrc.* file or an eslintConfig field in a package.json file"? [configuring](https://eslint.org/docs/2.0.0/user-guide/configuring) – Andy G Dec 21 '17 at 12:44
-
https://stackoverflow.com/questions/27732209/turning-off-eslint-rule-for-a-specific-line @Moritz you can check this question, you can understand how to disable eslint for line, for some part. – Yogesh Patel Dec 21 '17 at 12:44
-
@AndyG Whenever I create a package.json file, eslint doesn't work anymore with the error: "[object Object]" – Dec 21 '17 at 13:30
-
I would have thought there would be an existing file with the plugin to modify, rather than creating a new one. But this is the extent of my own knowledge, good luck. – Andy G Dec 21 '17 at 13:34
1 Answers
1
There are several ways to achieve this. You can disable it inline, by pasting this line in your source:
/*eslint-disable no-unused-vars*/
or if you're using .eslintrc file, you can add this to your rules block:
"no-unused-vars": ["off", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }]

Andrii
- 329
- 2
- 8
-
Thanks, the first method works perfectly, but when I create a .bablrc file eslint is still showing me the error. Is there a way to specify globally (for all .js files in my project) the rule? – Dec 21 '17 at 13:37
-
Hey @Moritz, try to just switch it off with "no-unused-vars": 0 And make sure your .eslintrc file is recognized by the editor. – Andrii Dec 21 '17 at 14:04