Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
970 views
in Technique[技术] by (71.8m points)

visual studio code - 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.

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...