Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
992 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...