Search code examples
visual-studio-codestylelint

Why the stylelint vscode extension is not working on my computer?


I follow the guide to install stylelint vscode extension, but it does not work on my computer.

I'm pretty sure that I follow all the necessary steps.

  • Install Extensions.
  • Disable the built-in linters in User setting.
  • Use npm to install stylelint and its standard configuration.
  • Create a .stylelintrc.json configuration file in the root of my project. screenshot of project structure
  • Run stylelint from command-line. The screenshot of command-line result

But the extention still not automatically validate the css, what is going wrong? screenshot of no problems


Solution

  • After reading the guide again, I found the setting stylelint.config and understand its definition:

    Set stylelint config option. Note that when this option is enabled, stylelint doesn't load configuration files.

    So I look at my vscode user setting, oh, stylelint.config: {}. After changing it to null, stylelint automatically validates the css file immediately.

    Phew~

    screenshot of successful validation from vscode stylelint extension