-
Notifications
You must be signed in to change notification settings - Fork 40
/
.eslintrc.json
85 lines (79 loc) · 3.24 KB
/
.eslintrc.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
"env": {
"browser": true
},
"globals": { "DG": false, "Raphael": false, "$": false, "SC": false, "sc_require": false,
"sc_super": false, "static_url": false, "NO": false, "YES": false,
"module": false, "require": false },
"plugins": ["react", "react-hooks"],
"extends": [ "eslint:recommended", "plugin:react/recommended", "plugin:json/recommended-with-comments" ],
"settings": {
"react": {
"createClass": "createReactClass", // Regex for Component Factory to use,
// default to "createReactClass"
"pragma": "React", // Pragma to use, default to "React"
"version": "detect" // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// default to latest and warns if missing
// It will default to "detect" in the future
}
},
"rules": {
// possible errors
"no-console": "off", // 19 console statements
"no-extra-parens": "off", // liberal use of extra parens
"no-prototype-builtins": "off", // 8 calls to hasOwnProperty
"no-template-curly-in-string": "error",
"no-unreachable": "error",
"no-unsafe-negation": "error",
// best practices
"array-callback-return": "error",
"block-scoped-var": "warn",
"consistent-return": "off", // liberal use of inconsistent returns, e.g. SproutCore properties
"dot-notation": ["warn", { "allowKeywords": false }],
"eqeqeq": ["error", "allow-null"],
"no-alert": "error",
"no-caller": "error",
"no-eval": "error",
"no-extra-bind": "off", // 18 extra binds
"no-global-assign": "error",
"no-invalid-this": "error",
"no-loop-func": "warn",
"no-new-wrappers": "error",
"no-proto": "error",
"no-sequences": "error",
"no-unmodified-loop-condition": "error",
"no-unused-expressions": ["error", { "allowShortCircuit": true }],
"no-useless-call": "error",
"no-useless-concat": "warn",
"no-useless-escape": "off", // 34 unnecessary escapes
"no-useless-return": "error",
"no-with": "error",
"radix": "error",
"wrap-iife": ["warn", "any"],
// strict mode
"strict": "off",
// variables
"no-shadow-restricted-names": "error",
"no-unused-vars": ["warn", { "vars": "all", "args": "none" }],
"no-use-before-define": "off", // 169 used before defined
// node.js/CommonJS
"no-mixed-requires": "warn",
// stylistic issues
"eol-last": "off", // 13 files missing final EOLs
"func-name-matching": "error",
"new-cap": ["warn", { "capIsNew": false }],
"new-parens": "warn",
"no-bitwise": "warn",
"no-lonely-if": "off", // 8 lonely ifs
"no-underscore-dangle": "off", // liberal use of leading underscores
"no-unneeded-ternary": "warn",
"no-whitespace-before-property": "warn",
"quote-props": ["error", "as-needed", { "keywords": true, "unnecessary": false }],
"quotes": "off",
"semi": ["error", "always"],
"react/display-name": "off",
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
}
}