I'm using StyleLint with Webpack.
My current Webpack configuration is:
module.exports.styleLint = (isProd = false) => {
const options = {
configFile: './.stylelintrc.json',
files: '**/*.less',
format: 'less',
failOnError: false,
quiet: false,
emitErrors: isProd
};
return new StyleLintPlugin(options);
};
How can I specify some folders or files to be ignored by StyleLint (I don't want to see any errors in the output)?
Note:
I don't want to add
/* stylelint-disable */
inside these files.
I used the following configuration in the stylelint config file:
{
"extends": "stylelint-config-recommended",
"ignoreFiles": [
"app/bootstrap/**/*.less"
]
}
And it skipped the files in the specified folder.
Another way to exclude something with a stylelint is to use the .stylelintignore
file.
You can use a .stylelintignore file to ignore specific files. For example:
**/*.js
vendor/**/*.css
The patterns in your .stylelintignore file must match .gitignore syntax. (Behind the scenes, node-ignore parses your patterns.) Your patterns in .stylelintignore are always analyzed relative to process.cwd().
stylelint looks for a .stylelintignore file in process.cwd(). You can also specify a path to your ignore patterns file (absolute or relative to process.cwd()) using the --ignore-path (in the CLI) and ignorePath (in JS) options.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With