Search code examples
visual-studio-codestylelint

Can I stop stylelint extension from validating JavaScript file?


Good day,

enter image description here

In above picture, stylelint prompt a CSS error in a JS file. Is there a way to stop stylelint from validating javascript file, I coundn't find such option in their official configuration guide.

Thanks a lot.


Solution

  • The linter can be configured to ignore specific files using the ignoreFiles property of the stylelint configuration object.

    You can try ignoring JavaScript files with:

    {
      "ignoreFiles": ["**/*.js"],
      "rules": { .. }
    }
    

    I believe the stylelint Visual Studio Code extension will respect this property.