|
12 | 12 | "env": {
|
13 | 13 | "node": true,
|
14 | 14 | "es6": true,
|
| 15 | + "es2017": true, |
15 | 16 | },
|
16 | 17 | "parserOptions": {
|
17 | 18 | "sourceType": "module",
|
18 | 19 | "ecmaVersion": 2020,
|
19 | 20 | },
|
20 | 21 | "rules": {
|
| 22 | + "array-bracket-spacing": [2, "never"], |
| 23 | + "arrow-body-style": [2, "as-needed"], |
| 24 | + "arrow-parens": [2, "always"], |
| 25 | + "arrow-spacing": [2, { "before": true, "after": true }], |
| 26 | + "block-spacing": [2, "always"], |
| 27 | + "brace-style": [2, "1tbs", { "allowSingleLine": true }], |
21 | 28 | "comma-dangle": ["error", {
|
22 | 29 | "arrays": "always-multiline",
|
23 | 30 | "objects": "always-multiline",
|
24 | 31 | "imports": "always-multiline",
|
25 | 32 | "exports": "always-multiline",
|
26 | 33 | "functions": "always-multiline",
|
27 | 34 | }],
|
| 35 | + "comma-spacing": [2, { "before": false, "after": true }], |
28 | 36 | "comma-style": [2, "last"],
|
29 |
| - "curly": [2, "multi-line"], |
| 37 | + "computed-property-spacing": [2, "never"], |
| 38 | + "curly": [2, "all"], |
| 39 | + "default-case": [2, { "commentPattern": "(?:)" }], |
| 40 | + "default-case-last": [2], |
| 41 | + "default-param-last": [2], |
| 42 | + "dot-location": [2, "property"], |
| 43 | + "dot-notation": [2, { "allowKeywords": true, "allowPattern": "throws" }], |
30 | 44 | "eol-last": [2, "always"],
|
31 | 45 | "eqeqeq": [2, "allow-null"],
|
32 |
| - "func-call-spacing": 2, |
33 |
| - "indent": [2, 2], |
| 46 | + "for-direction": [2], |
| 47 | + "function-call-argument-newline": [2, "consistent"], |
| 48 | + "func-call-spacing": [2, "never"], |
| 49 | + "implicit-arrow-linebreak": [2, "beside"], |
| 50 | + "indent": [2, 2, { |
| 51 | + "SwitchCase": 1, |
| 52 | + "VariableDeclarator": 1, |
| 53 | + "outerIIFEBody": 1, |
| 54 | + "FunctionDeclaration": { |
| 55 | + "parameters": 1, |
| 56 | + "body": 1 |
| 57 | + }, |
| 58 | + "FunctionExpression": { |
| 59 | + "parameters": 1, |
| 60 | + "body": 1 |
| 61 | + }, |
| 62 | + "CallExpression": { |
| 63 | + "arguments": 1 |
| 64 | + }, |
| 65 | + "ArrayExpression": 1, |
| 66 | + "ObjectExpression": 1, |
| 67 | + "ImportDeclaration": 1, |
| 68 | + "flatTernaryExpressions": false, |
| 69 | + }], |
| 70 | + "jsx-quotes": [2, "prefer-double"], |
| 71 | + "key-spacing": [2, { |
| 72 | + "beforeColon": false, |
| 73 | + "afterColon": true, |
| 74 | + "mode": "strict", |
| 75 | + }], |
34 | 76 | "keyword-spacing": ["error", {
|
35 | 77 | "before": true,
|
36 | 78 | "after": true,
|
|
40 | 82 | "case": { "after": true }
|
41 | 83 | }
|
42 | 84 | }],
|
| 85 | + "linebreak-style": [2, "unix"], |
| 86 | + "lines-around-directive": [2, { |
| 87 | + "before": "always", |
| 88 | + "after": "always", |
| 89 | + }], |
43 | 90 | "max-len": 0,
|
| 91 | + "new-parens": 2, |
| 92 | + "no-array-constructor": 2, |
| 93 | + "no-compare-neg-zero": 2, |
44 | 94 | "no-cond-assign": [2, "always"],
|
| 95 | + "no-extra-parens": 2, |
| 96 | + "no-multiple-empty-lines": [2, { "max": 1, "maxEOF": 1, "maxBOF": 0 }], |
45 | 97 | "no-return-assign": [2, "always"],
|
| 98 | + "no-trailing-spaces": 2, |
| 99 | + "no-use-before-define": [2, { "functions": true, "classes": true, "variables": true }], |
46 | 100 | "no-var": 2,
|
47 | 101 | "object-curly-spacing": [2, "always"],
|
48 | 102 | "object-shorthand": ["error", "always", {
|
49 | 103 | "ignoreConstructors": false,
|
50 |
| - "avoidQuotes": true, |
| 104 | + "avoidQuotes": false, |
| 105 | + "avoidExplicitReturnArrows": true, |
51 | 106 | }],
|
52 | 107 | "one-var": [2, "never"],
|
| 108 | + "operator-linebreak": [2, "none", { |
| 109 | + "overrides": { |
| 110 | + "?": "before", |
| 111 | + ":": "before", |
| 112 | + "&&": "before", |
| 113 | + "||": "before", |
| 114 | + }, |
| 115 | + }], |
53 | 116 | "prefer-const": 2,
|
| 117 | + "prefer-object-spread": 2, |
| 118 | + "prefer-rest-params": 2, |
| 119 | + "prefer-template": 2, |
| 120 | + "quote-props": [2, "as-needed", { "keywords": false }], |
54 | 121 | "quotes": [2, "single", {
|
55 | 122 | "allowTemplateLiterals": true,
|
56 | 123 | "avoidEscape": true,
|
57 | 124 | }],
|
| 125 | + "rest-spread-spacing": [2, "never"], |
58 | 126 | "semi": [2, "always"],
|
| 127 | + "semi-spacing": [2, { "before": false, "after": true }], |
| 128 | + "semi-style": [2, "last"], |
| 129 | + "space-before-blocks": [2, { "functions": "always", "keywords": "always", "classes": "always" }], |
59 | 130 | "space-before-function-paren": ["error", {
|
60 | 131 | "anonymous": "always",
|
61 | 132 | "named": "never",
|
62 | 133 | "asyncArrow": "always",
|
63 | 134 | }],
|
| 135 | + "space-in-parens": [2, "never"], |
| 136 | + "space-infix-ops": [2], |
| 137 | + "space-unary-ops": [2, { "words": true, "nonwords": false }], |
| 138 | + "switch-colon-spacing": [2, { "after": true, "before": false }], |
| 139 | + "template-curly-spacing": [2, "never"], |
| 140 | + "template-tag-spacing": [2, "never"], |
| 141 | + "unicode-bom": [2, "never"], |
| 142 | + "use-isnan": [2, { "enforceForSwitchCase": true }], |
| 143 | + "valid-typeof": [2], |
| 144 | + "wrap-iife": [2, "outside", { "functionPrototypeMethods": true }], |
| 145 | + "wrap-regex": [2], |
| 146 | + "yield-star-spacing": [2, { "before": false, "after": true }], |
| 147 | + "yoda": [2, "never", { "exceptRange": true, "onlyEquality": false }], |
64 | 148 |
|
65 | 149 | "eslint-plugin/consistent-output": [
|
66 | 150 | "error",
|
|
76 | 160 | "eslint-plugin/require-meta-type": "error",
|
77 | 161 |
|
78 | 162 | // dog fooding
|
79 |
| - "import/no-extraneous-dependencies": "error", |
| 163 | + "import/no-extraneous-dependencies": ["error", { |
| 164 | + "devDependencies": [ |
| 165 | + "tests/**", |
| 166 | + "resolvers/*/test/**", |
| 167 | + "scripts/**" |
| 168 | + ], |
| 169 | + "optionalDependencies": false, |
| 170 | + "peerDependencies": true, |
| 171 | + "bundledDependencies": false, |
| 172 | + }], |
80 | 173 | "import/unambiguous": "off",
|
81 | 174 | },
|
82 | 175 |
|
|
98 | 191 | },
|
99 | 192 | },
|
100 | 193 | {
|
101 |
| - "files": "resolvers/**", |
| 194 | + "files": [ |
| 195 | + "resolvers/**", |
| 196 | + "utils/**", |
| 197 | + ], |
102 | 198 | "env": {
|
103 | 199 | "es6": false,
|
104 | 200 | },
|
| 201 | + "parserOptions": { |
| 202 | + "sourceType": "module", |
| 203 | + "ecmaVersion": 2016, |
| 204 | + }, |
| 205 | + "rules": { |
| 206 | + "comma-dangle": ["error", { |
| 207 | + "arrays": "always-multiline", |
| 208 | + "objects": "always-multiline", |
| 209 | + "imports": "always-multiline", |
| 210 | + "exports": "always-multiline", |
| 211 | + "functions": "never" |
| 212 | + }], |
| 213 | + "prefer-destructuring": "off", |
| 214 | + "prefer-object-spread": "off", |
| 215 | + "prefer-rest-params": "off", |
| 216 | + "prefer-spread": "off", |
| 217 | + "prefer-template": "off", |
| 218 | + } |
105 | 219 | },
|
106 | 220 | {
|
107 |
| - "files": "resolvers/webpack/**", |
| 221 | + "files": [ |
| 222 | + "resolvers/webpack/**", |
| 223 | + "utils/**", |
| 224 | + ], |
108 | 225 | "rules": {
|
109 |
| - "import/no-extraneous-dependencies": 1, |
110 | 226 | "no-console": 1,
|
111 | 227 | },
|
112 |
| - "env": { |
113 |
| - "es6": true, |
| 228 | + }, |
| 229 | + { |
| 230 | + "files": [ |
| 231 | + "utils/**", // TODO |
| 232 | + "src/ExportMap.js", // TODO |
| 233 | + ], |
| 234 | + "rules": { |
| 235 | + "no-use-before-define": "off", |
| 236 | + }, |
| 237 | + }, |
| 238 | + { |
| 239 | + "files": [ |
| 240 | + "resolvers/webpack/index.js", |
| 241 | + "resolvers/webpack/test/example.js", |
| 242 | + "utils/parse.js", |
| 243 | + ], |
| 244 | + "rules": { |
| 245 | + "no-console": "off", |
114 | 246 | },
|
115 | 247 | },
|
116 | 248 | {
|
|
122 | 254 | "es6": false
|
123 | 255 | },
|
124 | 256 | },
|
125 |
| - { |
126 |
| - "files": "utils/**", |
127 |
| - "parserOptions": { |
128 |
| - "ecmaVersion": 6, |
129 |
| - }, |
130 |
| - "rules": { |
131 |
| - "comma-dangle": ["error", { |
132 |
| - "arrays": "always-multiline", |
133 |
| - "objects": "always-multiline", |
134 |
| - "imports": "always-multiline", |
135 |
| - "exports": "always-multiline", |
136 |
| - "functions": "never" |
137 |
| - }], |
138 |
| - "no-console": 1, |
139 |
| - }, |
140 |
| - }, |
141 | 257 | {
|
142 | 258 | "files": "tests/**",
|
143 | 259 | "env": {
|
|
0 commit comments