Last active
February 21, 2021 22:01
-
-
Save gupta-ji6/6d28603c7befb4801d4150876ef8952d to your computer and use it in GitHub Desktop.
ESLint + Prettier Setup for React Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"es2020": true, | |
"node": true | |
}, | |
"extends": [ | |
"eslint:recommended", | |
"plugin:react/recommended", | |
// "plugin:prettier/recommended", | |
"plugin:jsx-a11y/recommended", | |
"plugin:import/errors", | |
"plugin:import/warnings", | |
"airbnb", | |
"airbnb/hooks" | |
], | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true | |
}, | |
"ecmaVersion": 11, | |
"sourceType": "module" | |
}, | |
"plugins": ["react", "import", "jsx-a11y"], | |
"rules": { | |
"no-console": "warn", | |
"no-use-before-define": "error", | |
"quotes": "warn", | |
"jsx-quotes": "off", | |
"object-curly-newline": "warn", | |
"comma-dangle": "off", | |
"arrow-body-style": "off", | |
"no-unused-vars": "warn", | |
"operator-linebreak": "off", | |
"import/prefer-default-export": "warn", | |
"react/jsx-fragments": "off", | |
"react/prop-types": "off", | |
"react/no-array-index-key": "warn", | |
"react/jsx-filename-extension": [ | |
2, | |
{ | |
"extensions": [".js", ".jsx"] | |
} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"printWidth": 85, | |
"arrowParens": "always", | |
"semi": true, | |
"trailingComma": "es5", | |
"tabWidth": 2, | |
"singleQuote": true, | |
"jsxSingleQuote": true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Init Command -
eslint --init
devDependencies required are:
Command to install them all:
npm i -D babel-eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks