Errors on config comments suppressed
See original GitHub issueFrom .eslintrc.js
:
strict: ['error', 'global'],
'unicode-bom': ['error', 'always'],
Test doc 1:
Text ```js console.log('a'); ```
Result 1:
4:1 error Use the global form of 'use strict' strict
4:1 error Expected Unicode BOM (Byte Order Mark) unicode-bom
Test doc 2:
Text <!-- eslint-disable strict --> ```js console.log('a'); ```
Result 2:
[No errors]
- Maybe
unicode-bom
should be included in unsatisfiable rules. - Why
eslint-disable any-other-rule
comment also cancelsunicode-bom
?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Suppressing errors for file from comment · Issue #2606 - GitHub
I have an auto_prepend_file. When I check this file with psalm, it reports "DuplicateFunction" for all functions in this file, and I'd prefer...
Read more >Suppress code analysis violations - Visual Studio (Windows)
The global suppression file uses the SuppressMessage attribute. From the Error List, select the rules you want to suppress, and then right-click ...
Read more >Dealing with code issues - Documentation - Psalm
There are two ways to suppress an issue – via the Psalm config or via a function docblock. Config suppression. You can use...
Read more >Can comments be used in a Valgrind suppression file?
I need to maintain a Valgrind suppression file for a large project. We filter unfixable errors from a tool we link to. It's...
Read more >Enabling new ESLint rules in a legacy codebase with ...
suppress -eslint-errors is a tool that automatically adds disabling comments to each line with a lint rule violation.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I opened #84 to add
unicode-bom
to the list of unsatisfiable rules. I renamed this issue and will leave it open to see if there’s anything that can be done about errors on config comments pulled in from HTML being suppressed.Agreed. I’ll do that soon.
The config comment gets transformed and inserted into the code, so what gets linted looks like this:
The
unicode-bom
rule still throws an error on line 1, column 1, but the plugin silences all errors thrown on the generated config comments since they’re supposed to be invisible.