Skip to content

Instantly share code, notes, and snippets.

@ZibanPirate
Created March 15, 2018 11:37
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 ZibanPirate/c8044c3bc3df5e16e9a18322a35a83d5 to your computer and use it in GitHub Desktop.
Save ZibanPirate/c8044c3bc3df5e16e9a18322a35a83d5 to your computer and use it in GitHub Desktop.
eslint.rc for React
module.exports = {
"root": true,
"extends": ["eslint:recommended", "plugin:react/recommended"],
"env": {
"browser": true,
"commonjs": true,
"es6": true,
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"comma-dangle": ["error", "always-multiline"],
"comma-spacing": ["error", { "before": false, "after": true }],
"eol-last": ["error", "always"],
"indent": ["error", 2, { "MemberExpression": 1 }],
"no-multiple-empty-lines": ["error"],
"no-new-symbol": "error",
"no-trailing-spaces": ["error"],
"no-undef": ["error"],
"no-unused-vars": ["error"],
"object-curly-spacing": ["error", "always"],
"object-shorthand": "error",
"prefer-const": 2,
"quotes": ["error", "single"],
"semi": ["error", "never"],
"space-in-parens": ["error", "never"],
"strict": [2, "never"]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment