newline-after-var rule is broken with babel-eslint >= 9 #11839
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
question
This issue asks a question about ESLint
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
babel-eslint
Please show your full configuration:
Configuration
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 --ignore-path .gitignore '**/*.js'
What did you expect to happen?
expected eslint to not return any error
What actually happened? Please include the actual, raw output from ESLint.
Explanation
Since version
9.0.0
,babel-eslint
broke the eslint rulenewline-after-var
. the reason is that since that version they have been using@babel/parser@^7
and that changed how the code AST is generated. In the specificlet
token does not haveKeyword
type anymore but instead has typeIdentifier
(this is probably because of this so this problem is also loosely correlated to #11830)This change affect the
newline-after-var
rule as it use the following check to group together chunks of variable declaration (link to actual code):while the second part of the if is still valid the first now fails for
let
variables (this bug does not affectsconst
orvar
)Related babel-eslint issue
babel/babel-eslint#771
Are you willing to submit a pull request to fix this bug?
yes if we can agree on a solution and where to implement it (
eslint
@newline-after-var
rule orbabel-eslint
@babylon-to-espree
code)The text was updated successfully, but these errors were encountered: