Skip to content

Instantly share code, notes, and snippets.

@iannbing
Last active November 15, 2022 17:04
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save iannbing/472b9b5837ced3191cef7d94cd339971 to your computer and use it in GitHub Desktop.
Save iannbing/472b9b5837ced3191cef7d94cd339971 to your computer and use it in GitHub Desktop.
A gist for initial eslint and prettier setup for React projects
{
"extends": ["eslint:recommended", "plugin:react/recommended", "airbnb"],
"env": {
"es6": true,
"jest": true,
"browser": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"impliedStrict": true,
"experimentalObjectRestSpread": true
}
},
"plugins": [
"react",
"prettier"
],
"rules": {
"react/jsx-indent": [1, 4],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
}
}
{
"parser": "babylon",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"bracketSpacing": false,
"requirePragma": true,
"insertPragma": true,
"printWidth": 80
}
{
"devDependencies": {
"eslint": "^4.17.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.6.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment