We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当使用 @antfu/eslint-config 并开启 formatters: true 时, 对以下代码执行 eslint --fix 会报错:
@antfu/eslint-config
formatters: true
eslint --fix
<template> <div>test</div> </template> <style lang="less" scoped> .a { .b { .c { padding: 1rem; } } } </style>
注: 其中倒数第三行的空行包含两个空格 执行 eslint --fix 报错:
> eslint --fix test.vue Oops! Something went wrong! :( ESLint: 9.15.0 TypeError: Cannot read properties of undefined (reading 'range') at attemptFix (D:\YZW\Desktop\minimal-demo\node_modules\.pnpm\[email protected]\node_modules\eslint\lib\linter\source-code-fixer.js:88:27) at SourceCodeFixer.applyFixes (D:\YZW\Desktop\minimal-demo\node_modules\.pnpm\[email protected]\node_modules\eslint\lib\linter\source-code-fixer.js:123:17) at Linter.verifyAndFix (D:\YZW\Desktop\minimal-demo\node_modules\.pnpm\[email protected]\node_modules\eslint\lib\linter\linter.js:2329:43) at verifyText (D:\YZW\Desktop\minimal-demo\node_modules\.pnpm\[email protected]\node_modules\eslint\lib\eslint\eslint.js:329:48) at D:\YZW\Desktop\minimal-demo\node_modules\.pnpm\[email protected]\node_modules\eslint\lib\eslint\eslint.js:810:40 ELIFECYCLE Command failed with exit code 2.
同时, 针对 less 文件:
less
.a { .b { .c { padding: 1rem; } } }
注: 同样倒数第二行的空行也包含两个空格 执行 eslint --fix 之后 less 文件变成:
.a { .b { .c { padding: 1rem; } }
同时报错:
> eslint --fix test.less D:\YZW\Desktop\minimal-demo\test.less 1:2 error Parsing error: CssSyntaxError: Unclosed block format/prettier ✖ 1 problem (1 error, 0 warnings) ELIFECYCLE Command failed with exit code 1.
https://github.com/Yuan-ZW/eslint-minimal-example
System: OS: Windows 11 10.0.26120 CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12450H Memory: 3.32 GB / 15.71 GB Binaries: Node: 20.10.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.21 - C:\Program Files\nodejs\yarn.CMD npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD pnpm: 9.12.1 - C:\Program Files\nodejs\pnpm.CMD Browsers: Edge: Chromium (127.0.2651.86) Internet Explorer: 11.0.26100.1
pnpm
The text was updated successfully, but these errors were encountered:
Related: antfu/eslint-config#607
And you should report this issue to https://github.com/antfu/eslint-config
Sorry, something went wrong.
提错地方了😂
No branches or pull requests
Describe the bug
当使用
@antfu/eslint-config
并开启formatters: true
时, 对以下代码执行eslint --fix
会报错:注: 其中倒数第三行的空行包含两个空格
执行
eslint --fix
报错:同时, 针对
less
文件:注: 同样倒数第二行的空行也包含两个空格
执行
eslint --fix
之后less
文件变成:同时报错:
Reproduction
https://github.com/Yuan-ZW/eslint-minimal-example
System Info
Used Package Manager
pnpm
Validations
Contributions
The text was updated successfully, but these errors were encountered: