forked from dendronhq/dendron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
130 lines (128 loc) · 3.98 KB
/
.eslintrc.js
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
127
128
129
130
module.exports = {
root: true,
env: {
browser: true,
es6: true,
jest: true,
},
extends: ["plugin:react/recommended", "airbnb", "airbnb/hooks", "prettier"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
JSX: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2018,
sourceType: "module",
},
plugins: ["@typescript-eslint", "jest"],
rules: {
// don't care
"comma-dangle": "off",
"object-curly-newline": "off",
"arrow-body-style": "off",
"array-callback-return": "off",
"lines-between-class-members": "off",
"arrow-parens": "off",
"no-else-return": "off",
"implicit-arrow-linebreak": "off",
"no-unused-vars": "off",
"max-len": "off",
"prefer-template": "off",
"consistent-return": "off",
// less restrictive airbnb
"no-restricted-syntax": [
"error",
{
selector: "ForInStatement",
message:
"for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.",
},
{
selector: "WithStatement",
message:
"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
},
],
"no-continue": "off",
// don't agree with
"dot-notation": "off",
// Less restrictive version of airbnb
"no-labels": ["error", { allowLoop: true, allowSwitch: false }],
// prettier
indent: "off",
quotes: "off",
"newline-per-chained-call": "off",
"function-paren-newline": "off",
"brace-style": "off",
// runs into max-len issue
"operator-linebreak": "off",
// rest
// "import/no-extraneous-dependencies": "on",
// A temporary hack related to IDE not resolving correct package.json
"import/no-extraneous-dependencies": "off",
// copy from packages/web-client/.eslintrc.json
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-unused-vars": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off", // TODO should be turned on
"no-shadow": "off",
"@typescript-eslint/no-shadow": "off", // TODO should be turned on
"import/order": "off",
"import/no-cycle": "off",
// --- React
"react/prop-types": "off",
// we use 'logger' inside of hooks, gets flagged
"react-hooks/exhaustive-deps": "off",
// suppress errors for missing 'import React' in files
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [
1,
{ extensions: [".js", ".jsx", ".ts", ".tsx"] },
],
"react/destructuring-assignment": "off",
"react/jsx-curly-newline": "off",
"react/jsx-props-no-spreading": "off",
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"react/static-property-placement": "off",
"react/prefer-stateless-function": "off",
"react/no-did-update-set-state": "off",
"react/sort-comp": [
1,
{
order: [
"static-methods",
"instance-variables",
"lifecycle",
"/^on.+$/",
"everything-else",
"render",
],
},
],
// used for redux toolkit
"no-param-reassign": "off",
"max-classes-per-file": "off",
"spaced-comment": "off",
"prefer-destructuring": "off",
"no-useless-return": "off",
"import/prefer-default-export": "off",
"no-underscore-dangle": "off",
"class-methods-use-this": "off",
// problems with this
"prettier/prettier": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
},
};