eslint-plugin-antfu
eslint-plugin-antfu copied to clipboard
Auto-fix produces broken syntax `consistent-list-newline`
trafficstars
Describe the bug
Auto-fix of consistent-list-newline generates broken Javascript code.
Before:
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
coverage: {
include: ['fixtures/src/math.ts',
// Don't wrap this
'a',
'b',
'c',
// Stay in place
],
exclude: ['nothing'],
},
}
})
After --fix:
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
coverage: {
include: ['fixtures/src/math.ts',
// Don't wrap this
'a', 'b', 'c', // Stay in place ],
exclude: ['nothing'],
},
},
})
Reproduction
https://stackblitz.com/~/edit/stackblitz-starters-y5brk2hz
System Info
Stackblitz, Node 18.
"@antfu/eslint-config": "^4.4.0",
"eslint": "^9.21.0"
Used Package Manager
npm
Validations
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guide.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [x] The provided reproduction is a minimal reproducible of the bug.
Contributions
- [ ] I am willing to submit a PR to fix this issue
- [ ] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
Also got hit by this
const hitArea = new Polygon([ 0, 32, // left
64, 0, // top
2 * 64, 32, // right
64, 2 * 32, // bottom
])
const hitArea = new Polygon([ 0, 32, // left
64, 0, // top
2 * 64, 32, // right
64, 2 * 32, // bottom])