Merge pull request #932 from pdehaan/eslint-react

Add react/recommended ESLint rules
This commit is contained in:
Wyatt Johnson
2017-09-15 17:29:28 -06:00
committed by GitHub
+72 -61
View File
@@ -1,63 +1,74 @@
{
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 2017
},
"plugins": [
"promise",
"json"
],
"rules": {
"indent": ["error", 2],
"no-console": "off",
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"no-template-curly-in-string": "warn",
"no-unsafe-negation": "warn",
"array-callback-return": "warn",
"arrow-parens": ["warn", "always"],
"template-curly-spacing": "warn",
"eqeqeq": ["error", "smart"],
"no-eval": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"lines-around-comment": ["warn", {"beforeLineComment": true}],
"spaced-comment": ["warn", "always", {"line": {"exceptions": ["-", "="]}}],
"no-script-url": "error",
"no-throw-literal": "error",
"yoda": "warn",
"no-path-concat": "error",
"eol-last": "warn",
"no-nested-ternary": "warn",
"no-tabs": "error",
"no-unneeded-ternary": "warn",
"object-curly-spacing": "warn",
"space-infix-ops": ["error"],
"space-in-parens": ["error", "never"],
"space-unary-ops": ["error", {"words": true, "nonwords": false}],
"no-const-assign": "error",
"no-duplicate-imports": "error",
"prefer-template": "warn",
"comma-spacing": ["error", {"after": true}],
"no-var": "error",
"no-lonely-if": "error",
"curly": "error",
"no-unused-vars": ["error", {"argsIgnorePattern": "^_|next", "varsIgnorePattern": "^_"}],
"no-multiple-empty-lines": ["error", {"max": 1}],
"newline-per-chained-call": ["error", {"ignoreChainWithDepth": 2}],
"promise/no-return-wrap": "error",
"promise/param-names": "error",
"promise/catch-or-return": "warn",
"promise/no-native": "off",
"promise/no-nesting": "warn",
"promise/no-promise-in-callback": "warn",
"promise/no-callback-in-promise": "warn"
}
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaVersion": 2017
},
"plugins": [
"json",
"promise",
"react"
],
"rules": {
"promise/no-return-wrap": "error",
"promise/param-names": "error",
"promise/catch-or-return": "warn",
"promise/no-native": "off",
"promise/no-nesting": "warn",
"promise/no-promise-in-callback": "warn",
"promise/no-callback-in-promise": "warn",
// TODO: Change all these to "error", or remove and use defaults.
"react/display-name": "off",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-no-target-blank": "warn",
"react/no-find-dom-node": "warn",
"react/no-unknown-property": "warn",
"react/prop-types": "off",
"array-callback-return": "warn",
"arrow-parens": ["warn", "always"],
"comma-spacing": ["error", {"after": true}],
"curly": "error",
"eol-last": "warn",
"eqeqeq": ["error", "smart"],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"lines-around-comment": ["warn", {"beforeLineComment": true}],
"newline-per-chained-call": ["error", {"ignoreChainWithDepth": 2}],
"no-console": "off",
"no-const-assign": "error",
"no-duplicate-imports": "error",
"no-eval": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"no-lonely-if": "error",
"no-multiple-empty-lines": ["error", {"max": 1}],
"no-nested-ternary": "warn",
"no-path-concat": "error",
"no-script-url": "error",
"no-tabs": "error",
"no-template-curly-in-string": "warn",
"no-throw-literal": "error",
"no-unneeded-ternary": "warn",
"no-unsafe-negation": "warn",
"no-unused-vars": ["error", {"argsIgnorePattern": "^_|next", "varsIgnorePattern": "^_"}],
"no-var": "error",
"object-curly-spacing": "warn",
"prefer-template": "warn",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"space-in-parens": ["error", "never"],
"space-infix-ops": ["error"],
"space-unary-ops": ["error", {"words": true, "nonwords": false}],
"spaced-comment": ["warn", "always", {"line": {"exceptions": ["-", "="]}}],
"template-curly-spacing": "warn",
"yoda": "warn"
}
}