-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
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
CSS properties in comments increase indefinitely. #489
Comments
@ddryo Can you provide your |
Yes, here is the setting data. {
"html.format.enable": false,
"javascript.format.enable": false,
"css.format.enable": false,
"eslint.format.enable": false,
} |
Thanks for the quick response. But I cannot reproduce the problem for some reason. 🤔 Can you reproduce it on your console (CLI) instead? E.g. npx stylelint test.scss --fix |
This problem occurred when tested in an environment with only the following two files pckage.json {
"name": "stylelint-test",
"version": "1.0",
"description": "",
"main": "dist/index.js",
"module": "dist/index.js",
"scripts": {},
"private": true,
"license": "MIT",
"devDependencies": {
"stylelint": "^16.2.0"
}
} test.scss .test {
color: red;
background-color: #fff;
// background-color: blue;
}
// .hoge{
// color:yellow;
// }
|
@ybiquitous As explained at the beginning, this only occurs when auto-formatting with VS Code extensions. |
Come to think of it, I use pnpm. node is v18.19.0. |
@ddryo Thanks for the minimum reproduction. This problem seems specific to the VSCode extension, so I'll transfer this issue to https://github.com/stylelint/vscode-stylelint. |
Additional verification. It does not occur in stylelint v.15.11.0, it occurs starting from v.16.0.0. |
Just to confirm, does this problem happen without the config file ( |
No, this occurred with or without .stylelintrc.cjs. |
If I wanted to use stylelint-prettier v5 or later, I had to use stylelint v16 or later to get it to work, so I updated to stylelint v16 and encountered this bug. At first I thought it might be due to prettier, but as I described above, it also occurred in an environment with only 2 files (counted before node_module installation). So I think VS Code plugin and stylelint v16 are incompatible. |
It's strange. I cannot reproduce this problem for now with the 2 files and |
It may be correct. The main branch hasn't tested v16 yet: Line 249 in 39e7c76
|
I think there is no problem if Stylelint and the extension are configured properly. The following files are in my environment:
export default {
customSyntax: "postcss-scss",
rules: {
"function-name-case": "upper",
},
};
{
"devDependencies": {
"postcss-scss": "^4.0.9",
"stylelint": "^16.2.0"
}
}
{
"stylelint.validate": ["css", "scss"],
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
}
}
a {
color: calc(1 + 2);
} When the file above is saved, it's automatically converted to: - color: calc(1 + 2);
+ color: CALC(1 + 2); Screen.Recording.2024-01-29.at.23.22.17.mov |
Thank you very much! However, the bug did occur... CleanShot.2024-01-29.at.23.27.00-converted.mp4 |
Hum, I cannot reproduce unintentionally inserted comments... 🤔 I wonder if {
"stylelint.validate": ["css", "scss"],
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": true
}
} |
Yes. But for some reason, when I reload the project, the
|
The behavior doesn't seem to change between |
FYI, I've just opened PR #492 to reduce confusion in README. |
在stylelint16.x中我也遇到了同样的问题,格式化的时候,它会无限的追加注释
|
same here |
|
What minimal example or steps are needed to reproduce the bug?
I use VS Code's stylelint plugin to automatically run fix when saving a file.
However, at this time, for some reason, the CSS property name being purchased within the comment is copied to the end of the comment. (There was no problem when I fixed it with the
stylelint --fix
command.CleanShot.2024-01-29.at.17.52.58.mp4
Also, this problem has been occurring since updating stylelint from v15 to v16.
What minimal configuration is needed to reproduce the bug?
.stylelintrc.cjs
How did you run Stylelint?
This problem seems to occur when you use a VS Code extension to automatically format a file when saving it.
Which Stylelint-related dependencies are you using?
What did you expect to happen?
I just want to save the file normally.
What actually happened?
CSS properties in comments increase indefinitely.
Do you have a proposal to fix the bug?
No response
The text was updated successfully, but these errors were encountered: