<!-- eslint-disable --> does not work in the v1.0.0-beta.6
See original GitHub issue1. I’ve found an error on the v1.0.0-beta.4: <!-- eslint-disable some-rule -->
completely disables parsing the whole fragment and even the next fragment:
test.md
### Heading
Text
` ``js
console.log('a')
` ``
` ``js
console.log('b')
` ``
` ``js
console.log('c')
` ``
Error log:
6:1 error Use the global form of 'use strict' strict
6:17 error Missing semicolon semi
11:1 error Use the global form of 'use strict' strict
11:17 error Missing semicolon semi
16:1 error Use the global form of 'use strict' strict
16:17 error Missing semicolon semi
test.md
with comments:
### Heading
Text
<!-- eslint-disable strict -->
` ``js
console.log('a')
` ``
` ``js
console.log('b')
` ``
` ``js
console.log('c')
` ``
Error log (semi
errors for the fragments 1 and 2 are not reported; fragment 2 is ignored):
17:1 error Use the global form of 'use strict' strict
17:17 error Missing semicolon semi
2. So I’ve tried to update to v1.0.0-beta.6 and make a PR for Node.js. v1.0.0-beta.6 seems to fix this issue, but it has a new breaking one: code blocks with <!-- eslint-disable -->
are parsed and throws if parsing errors found:
test.md
:
### Heading
Text
<!-- eslint-disable -->
` ``js
console.log('a') bang
` ``
Error log:
7:18 error Parsing error: Unexpected token bang
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
[eslint][node.js] eslint-disable not working - Stack Overflow
I'm trying to disable eslint for a line of code but to no effect. I tried to tackle the problem as in eslint...
Read more >no-arrow-condition - ESLint - Pluggable JavaScript Linter
Disallows arrow functions where test conditions are expected. (removed) This rule was removed in ESLint v2.0 and replaced by a combination of the ......
Read more >eslint-plugin-markdown | Yarn - Package Manager
An ESLint plugin to lint JavaScript in Markdown code fences. ... A JS code snippet in a Markdown editor has red squiggly underlines....
Read more >disable eslint react/function-component-definition - You.com
This is explained because ESLint cannot recognize the render prop pattern because you are not directly writing this render prop into a component, ......
Read more >Command Line Interface - ESLint - Pluggable JavaScript linter
Command Line Interface. To run ESLint on Node.js, you must have npm installed. If npm is not installed, follow the instructions here: https://www.npmjs.com/....
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 just submitted a pull request to implement
<!-- eslint-skip -->
comments in Markdown: https://github.com/eslint/eslint-plugin-markdown/pull/73. Let me know what you think!@vsemozhetbyt that makes sense, thanks for explaining.
As a first step, I tracked down what was causing the behavior you observed in beta.4. It turns out that the Markdown parser in use at the time wasn’t picking up code fences unless they were preceded by blank lines. I’ve added a test in #72 to make sure that doesn’t happen again.
Since your disable comments and code fences were on adjacent lines, the processor wasn’t even getting those code blocks back from the parser. I’m glad that bug was fixed in a beta! 😅
Now, as for supporting your use case. I’d like to keep the meaning of
eslint-disable
the same in ESLint core and this processor, as I fear it could introduce confusion otherwise. With that in mind, how about I add support for a new<!-- eslint-skip -->
comment that would exclude the code fence from parsing entirely? If that works for you, I’ll run it by the rest of the team to make sure I’m not stepping on any toes with that. It would look like this: