I need to exclude css files from the eslint parser.
Currently when I run eslint src/**
this is checking all the files including css files. .
Please find below my eslintrc file contents.
module.exports = {
"parser": "babel-eslint",
"extends": "airbnb",
"plugins": [
"react",
"jsx-a11y",
"import"
],
"env" : {
"browser": true
}
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
},
};
You can tell ESLint to ignore specific files and directories using ignorePatterns in your config files. ignorePatterns patterns follow the same rules as . eslintignore .
❓ Why is it ESLint plugin? Stylelint partially supports CSS in JS, but some issues haven't been resolved for a long time. Also, CSS definitions using template literals are similar to CSS syntax, but CSS definitions using JavaScript objects are not. ESLint may work better for linting JavaScript objects.
To temporarily turn off ESLint, you should add a block comment /* eslint-disable */ before the lines that you're interested in: /* eslint-disable */ console.
.eslintignore file to ignore styles would work nicely. Inside, do something like this: *.css
Here's a good starting point with these techs, which I actually found while reading another, similar SO post
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