-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.eslintrc
126 lines (121 loc) · 4.3 KB
/
.eslintrc
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
"env": {
"browser": true,
"es6": true,
"amd": true,
"node": true,
"jest/globals": true
},
"ignorePatterns": ["*original*"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": ["./tsconfig.json"]
},
"globals": {
"gapi": false,
"google": false
},
"plugins": ["react", "@typescript-eslint", "babel", "jest"],
"extends": [ "eslint:recommended", "plugin:react/recommended" ],
"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": "warn",
"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": ["off", { "allowKeywords": false }],
"@typescript-eslint/dot-notation": ["warn", { "allowKeywords": false }],
"eqeqeq": ["error", "allow-null"],
"@typescript-eslint/member-delimiter-style": ["warn", {
"multiline": { "delimiter": "none" },
"singleline": { "delimiter": "comma" }
}],
"no-alert": "error",
"no-caller": "error",
"no-eval": "error",
// "no-extra-bind": "off", // 18 extra binds
"no-global-assign": "error",
"no-invalid-this": "off",
"babel/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": ["off", { "vars": "all", "args": "none" }],
"@typescript-eslint/no-unused-vars": ["warn", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
"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": "off",
"@typescript-eslint/semi": ["warn", "never"],
"react/display-name": "off",
"react/prop-types": "off", // TODO: FIX THIS
"react/no-find-dom-node": "off" // TODO: Fix this!!!
},
"overrides": [
{ // rules specific to Jest tests
"files": ["src/**/*.test.*", "src/test/**"],
"env": {
"node": true,
"jest": true
},
"globals": {
"jestSpyConsole": "readonly"
},
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"],
"rules": {
"@typescript-eslint/no-non-null-assertion": "off",
// require() can be useful in mocking
"@typescript-eslint/no-require-imports": "off",
"@typescript-eslint/no-var-requires": "off",
"jest/no-disabled-tests": "off",
"jest/no-done-callback": "off",
"jest/no-focused-tests": "off"
}
}
]
}