Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 731
Paris Qian Sen Avatar asked Jun 01 '18 08:06

Paris Qian Sen


People also ask

How to ignore file stylelint?

You can also specify a path to your ignore patterns file (absolute or relative to process. cwd() ) using the --ignore-path (in the CLI) and ignorePath (in JS) options. Alternatively, you can add an ignoreFiles property within your configuration object.


1 Answers

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.

like image 155
jeddy3 Avatar answered Sep 20 '22 07:09

jeddy3