stylelint / vscode-stylelint

The official Visual Studio Code extension for Stylelint

Home Page:https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: Do not require `stylelint.validate`

Zwyx opened this issue · comments

commented

What problem does this feature solve?

Hi all and thanks for making Stylelint!

To make the VS Code extension validate SCSS files, we have to add this entry to the VS Code workspace or user settings:

	"stylelint.validate": [
		"css",
		"scss"
	]

It's easy to add this entry to a project by adding it in the .vscode/settings.json file, so every developer opening the project in VS Code will have Stylelint working.

However, when opening a parent folder, containing multiple repositories (API, front-end, etc.), then VS Code does not read <parent-folder/Front-end/.vscode/settings.json>.

So every developer has to manually create a <parent-folder>/.vscode/settings.json file and insert the stylelint.validate option in. This file is outside all git repository so cannot be committed anywhere.

It would be more practical to have the VS Code extension only relying on the .stylelintrc file to determine which files has to be validated.

How does this feature solve the problem?

Having the VS Code extension only relying on .stylelintrc would allow all the Stylelint related configuration to be committed, and remove the need for every developers to manually configure their workspace settings.

What are some alternatives to this feature?

Ask all devs to manually create a .vscode/settings.json file in their root directory.

Code of Conduct

  • I agree to follow vscode-stylelint's Code of Conduct
commented

Hi again,

Turns out there is a way to do this already. Instead of opening the root folder, which creates a single-root workspace, we need to create a new workspace and manually add folders in it. This create a multi-root workspace, where per-folder settings are supported.

Cheers!