vscode-stylelint: CSS properties in comments increase indefinitely.

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.

.test {
	color: red;
	background-color: #fff;

	// background-color: blue;
}

// .hoge{
//     color:yellow;
// }

https://github.com/stylelint/stylelint/assets/31400297/3ce325bf-b7a4-4fef-96da-58cfba620a8a

Also, this problem has been occurring since updating stylelint from v15 to v16.

What minimal configuration is needed to reproduce the bug?

.stylelintrc.cjs

module.exports = {
	extends: [
		'stylelint-config-recommended-scss',
	],
};

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?

{
    "stylelint": "^16.2.0",
    "stylelint-config-recommended-scss": "^14.0.0",
}

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

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Reactions: 1
  • Comments: 24 (11 by maintainers)

Most upvoted comments

FYI, I’ve just opened PR #492 to reduce confusion in README.

So I think VS Code plugin and stylelint v16 are incompatible.

It may be correct. The main branch hasn’t tested v16 yet:

https://github.com/stylelint/vscode-stylelint/blob/39e7c76070bb5cfe678ace65de3a30d69e092196/package.json#L249

@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.

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;
// }

Yes, here is the setting data.

{
	"html.format.enable": false,
	"javascript.format.enable": false,
	"css.format.enable": false,
	"eslint.format.enable": false,
}