Skip to content

Instantly share code, notes, and snippets.

@MelodicCrypter
Last active September 14, 2020 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MelodicCrypter/b335af328de51b520b71a73b8ee3f9ec to your computer and use it in GitHub Desktop.
Save MelodicCrypter/b335af328de51b520b71a73b8ee3f9ec to your computer and use it in GitHub Desktop.
Common Dev Dependencies and Their Configurations (ESLint and Prettier). Check all four files inside this gist. TL-DR: yarn add -D babel-eslint babel-plugin-module-resolver eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks gatsby-plugin-eslint eslint-loader…
node_modules
.next
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true,
"jest": true
},
"plugins": [
"react",
"react-hooks",
"prettier"
],
"extends": [
"airbnb",
"prettier",
"plugin:prettier/recommended",
"plugin:react/recommended",
"prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2018,
"allowImportExportEverywhere": false,
"codeFrame": false,
"ecmaFeatures": {
"jsx": true
},
},
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
// React specifics
"react/no-unused-prop-types": 0,
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/button-has-type": 0,
"react/jsx-filename-extension": ["off"],
"react/prop-types": "warn",
// ESLint specifics
"max-len": ["error", {"code": 100}],
"prefer-promise-reject-errors": ["off"],
"no-nested-ternary": "off",
"no-return-assign": ["off"],
"no-shadow": "off",
"no-lonely-if": "warn",
"consistent-return": "off",
"no-use-before-define": "warn",
"no-underscore-dangle": "off",
"no-unused-vars": "warn",
"import/no-unresolved": "off",
"no-unused-expressions": "off",
"radix": "off",
"spaced-comment": "off",
"jsx-a11y/alt-text": "warn",
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/no-noninteractive-element-interactions": "warn",
"prettier/prettier": "error",
"arrow-parens": ["error", "always"]
}
}
package-lock.json
.next
node_modules/
{
"trailingComma": "es5",
"tabWidth": 4,
"endOfLine": "lf",
"printWidth": 100,
"semi": true,
"singleQuote": true,
"arrowParens:": "always"
}
yarn add -D babel-eslint babel-plugin-module-resolver eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-loader prettier pretty-quick gatsby-plugin-eslint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment