Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to exclude css files from eslint parser in React

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"] }],
    },

};
like image 229
Shamnad P S Avatar asked Apr 26 '17 06:04

Shamnad P S


People also ask

How do I ignore a folder in ESLint?

You can tell ESLint to ignore specific files and directories using ignorePatterns in your config files. ignorePatterns patterns follow the same rules as . eslintignore .

Does ESLint work with CSS?

❓ 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.

How do you turn off lint in react?

To temporarily turn off ESLint, you should add a block comment /* eslint-disable */ before the lines that you're interested in: /* eslint-disable */ console.


1 Answers

.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

like image 71
Todd Avatar answered Sep 30 '22 16:09

Todd