3.16.0 regression: padded-blocks autofix can generate incorrect code #8116
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
core
Relates to ESLint's core APIs and features
patch candidate
This issue may necessitate a patch release in the next few days
regression
Something broke
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
(This is the value specified by eslint-config-airbnb.)
What did you do? Please include the actual source code causing the issue.
I ran
eslint --fix
on this source code:What did you expect to happen?
I expected it to fix the formatting and generate correct code.
What actually happened? Please include the actual, raw output from ESLint.
eslint generated this output:
And the JS file was changed to have these contents:
This is a syntax error, so the file fails to parse after this change.
When I try this on eslint 3.15.0, it doesn't have any problems.
This is breaking the coffeelint example build for the decaffeinate project. The lexical_linter.js file has two
static initClass
lines near the start, which causes a syntax error. (The example builds are a bit like eslint-canary for the decaffeinate project, and one of the conversion steps is to runeslint --fix
on the resulting JS code.)The text was updated successfully, but these errors were encountered: