[ESLint v8] Revert line comment directive support
See original GitHub issueTell us about your environment
- ESLint Version: v8.0.0-beta.0
- Node Version: v16.6.0
- npm Version: v7.19.1
- Operating System: MacOS
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using?
default
Please show your full configuration:
module.exports = {
rules: {
'no-unused-vars': 'error',
}
};
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
// eslint comment that's not actually an eslint comment
// global augmentation can be in any file, and they do not need exports
yarn eslint ./test.js
What did you expect to happen?
No errors
What actually happened? Please copy-paste the actual, raw output from ESLint.
$ /Users/bradzacher/testbed/node_modules/.bin/eslint ./test.js
/Users/bradzacher/testbed/test.js
1:1 error Failed to parse JSON from ' comment that's not actually an eslint comment': Unexpected token c in JSON at position 2
2:11 error 'augmentation' is defined but never used no-unused-vars
2:24 error 'can' is defined but never used no-unused-vars
2:28 error 'be' is defined but never used no-unused-vars
2:31 error 'in' is defined but never used no-unused-vars
2:34 error 'any' is defined but never used no-unused-vars
2:38 error 'file' is defined but never used no-unused-vars
2:44 error 'and' is defined but never used no-unused-vars
2:48 error 'they' is defined but never used no-unused-vars
2:53 error 'do' is defined but never used no-unused-vars
2:56 error 'not' is defined but never used no-unused-vars
2:60 error 'need' is defined but never used no-unused-vars
2:65 error 'exports' is defined but never used no-unused-vars
✖ 13 problems (13 errors, 0 warnings)
Steps to reproduce this issue:
- create new folder
- install eslint v8
- add a file test.js with the above code
- add an eslintrc as above
- run eslint on the file
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Rules - ESLint - Pluggable JavaScript Linter
Rules in ESLint are grouped by type to help you understand their purpose. ... Enforce a particular style for multiline comments. Categories: ✓...
Read more >Support for ESLint v8 · Issue #3738 - GitHub
ESLint has just released the first beta version of v8. ... Breaking: allow all directives in line comments; Breaking: support new regex d...
Read more >eslint | Yarn - Package Manager
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. ... changelog. v8.30.0 - December 16, 2022.
Read more >vue/comment-directive - eslint-plugin-vue
It supports usage of the following comments: eslint-disable; eslint-enable; eslint-disable-line; eslint-disable-next-line.
Read more >Introducing GraphQL-ESLint! – The Guild
... gql usages in code files, and /* GraphQL */ magic comments. ... Supports ESLint directives (for example: # disable-next-line ) ...
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 Free
Top 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
the change was to improve the DX, but we have to reconsider it if it brings quite a few migrations cost.
just a thought: as the eslint evolves, at some point we may change the eslint directives to be more consistent(
eslint-xxx
), e.g.I’m fine with reverting. It seems like the cost outweighs the added value. If we want to reintroduce at some point then I agree with @aladdin-add’s point that coming up with an unambiguous format is the right way to go.