Skip to content

Instantly share code, notes, and snippets.

@gupta-ji6

gupta-ji6/.eslintrc.json

Last active Feb 21, 2021
Embed
What would you like to do?
ESLint + Prettier Setup for React Project
{
"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"]
}
]
}
}
{
"printWidth": 85,
"arrowParens": "always",
"semi": true,
"trailingComma": "es5",
"tabWidth": 2,
"singleQuote": true,
"jsxSingleQuote": true
}
@gupta-ji6

This comment has been minimized.

Copy link
Owner Author

@gupta-ji6 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