Can I stop stylelint extension from validating JavaScript file?

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.


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.