Can I stop stylelint extension from validating JavaScript file?

前端 未结 3 1989
太阳男子
太阳男子 2020-12-20 17:47

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 su

相关标签:
3条回答
  • 2020-12-20 18:08

    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.

    0 讨论(0)
  • 2020-12-20 18:10

    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.

    0 讨论(0)
  • 2020-12-20 18:29

    stylelint:validate You can stop style-lint from VScode to ignore the javascript file too.

    In settings search for stylelint -> at the bottom you can see Stylelint:Validate part. Select javascript and delete. It should fix your problem

    0 讨论(0)
提交回复
热议问题