Skip to content

Instantly share code, notes, and snippets.

Last active Feb 21, 2021
What would you like to do?
ESLint + Prettier Setup for React Project
"env": {
"browser": true,
"es2020": true,
"node": true
"extends": [
// "plugin:prettier/recommended",
"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": [
"extensions": [".js", ".jsx"]
"printWidth": 85,
"arrowParens": "always",
"semi": true,
"trailingComma": "es5",
"tabWidth": 2,
"singleQuote": true,
"jsxSingleQuote": true
Copy link

gupta-ji6 commented Oct 8, 2020

Init Command - eslint --init

devDependencies required are:

  1. babel-eslint
  2. eslint-config-airbnb
  3. eslint-plugin-import
  4. eslint-plugin-jsx-a11y
  5. eslint-plugin-react
  6. eslint-plugin-react-hooks

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment