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]: please open more stylelint `when clause` keys to enable custom keybindings

BobbyJonas opened this issue · comments

commented

What problem does this feature solve?

Personally, whether using ESLint or StyleLint to lint code, I prefer to run the executeAutofix command manually, rather than setting it in codeActionsOnSave to do it automatically on save.

To do this, usually I set a custom keybinding in VSCode, by which users specify the keyboard key combination and the when clause attribute for the editor to execute the formatting command (executeAutofix or sth) later.

ESLint exposes a specified when clause attribute called dbaeumer.vscode-eslint.enabled, which is true when the user has set ESLint as the default formatter and the ESLint extension is available.
With this attribute, I could control VSCode to run the ESLint executeAutofix command after my custom keybinding is triggered, if ESLint is available.

However, It seems that StyleLint doesn't have this when clause attribute, therefore I can't set a keybinding with the Stylelint linting command executeAutofix in VSCode.

(Besides, although StyleLint can be used as a "formatter", the built-in Format Document with StyleLint command in VSCode does not seem to work properly. )

How does this feature solve the problem?

Expose more when clause attributes in VSCode, which allow users to:

  • Determine whether StyleLint extension is available currently
  • Determine whether StyleLint is set as the default formatter

What are some alternatives to this feature?

No response

Code of Conduct

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