Can I stop stylelint extension from validating JavaScript file?

独自空忆成欢 提交于 2019-12-29 08:37:17

问题


Good day,

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.


回答1:


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.




回答2:


Look at this part in the documentation.

You can specify /* stylelint-disable */ at the top of a file to disable the whole file from being lint.

Or, better, juste specify /* stylelint-disable-line */ to disable for a single line.



来源:https://stackoverflow.com/questions/50639654/can-i-stop-stylelint-extension-from-validating-javascript-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!