Skip to content

Instantly share code, notes, and snippets.

@aszx87410
Created June 23, 2018 06:09
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 aszx87410/1aba246fe2330b33785e74f62bf64c22 to your computer and use it in GitHub Desktop.
Save aszx87410/1aba246fe2330b33785e74f62bf64c22 to your computer and use it in GitHub Desktop.
//.eslintrc
{
"env": {
"browser": true,
"es6": true,
"node": true,
"jest": true
},
"parser": "babel-eslint",
"plugins": [
"react",
"jest"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:import/warnings",
"plugin:jest/recommended",
"prettier"
],
"rules": {
"jsx-quotes": ["warn", "prefer-single"],
"no-console": "error",
"no-unused-vars": "error",
"react/display-name": "error",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
"no-useless-escape": "error",
"eqeqeq": "error",
"no-eval": "error",
"radix": "error",
"no-bitwise": "error",
"no-nested-ternary": "error",
"no-var": "error",
"react/sort-comp": "error",
"react/sort-prop-types": "error",
"react/jsx-sort-props": "error"
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"globals": {
"firebase": false
}
}
//.prettierrc
{
"semi": false,
"singleQuote": true
}
// package.json
{
"scripts": {
"format": "prettier --write \"{src,config}/**/*{.js,.jsx}\"",
"lint": "eslint --ext .jsx --ext .js src config",
"precommit": "lint-staged",
},
"lint-staged": {
"*.{js,jsx}": [
"prettier --write",
"eslint --fix",
"git add"
],
"*.less": [
"prettier --write",
"git add"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment