@newsteam/eslint-config 0.0.190 → 0.0.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/overrides/javascript.js +1 -1
- package/dist/cjs/overrides/typescript.js +4 -2
- package/dist/cjs/plugins/array-function.js +2 -2
- package/dist/cjs/plugins/es/es2015.js +2 -2
- package/dist/cjs/plugins/es/es2016.js +2 -2
- package/dist/cjs/plugins/es/es2017.js +2 -2
- package/dist/cjs/plugins/es/es2018.js +2 -2
- package/dist/cjs/plugins/es/es2019.js +2 -2
- package/dist/cjs/plugins/es/es2020.js +2 -2
- package/dist/cjs/plugins/es/es2021.js +2 -2
- package/dist/cjs/plugins/es/es5.js +2 -2
- package/dist/cjs/plugins/es/index.js +1 -1
- package/dist/cjs/plugins/eslint-comments/best-practices.js +3 -3
- package/dist/cjs/plugins/eslint-comments/index.js +1 -1
- package/dist/cjs/plugins/eslint-comments/style.js +2 -2
- package/dist/cjs/plugins/filenames.js +2 -2
- package/dist/cjs/plugins/format-message.js +5 -5
- package/dist/cjs/plugins/import/index.js +6 -6
- package/dist/cjs/plugins/import/module-systems.js +2 -2
- package/dist/cjs/plugins/import/static-analysis.js +2 -2
- package/dist/cjs/plugins/import/style.js +7 -7
- package/dist/cjs/plugins/import/warnings.js +2 -2
- package/dist/cjs/plugins/import-newlines.js +3 -3
- package/dist/cjs/plugins/more.js +2 -2
- package/dist/cjs/plugins/no-unsanitized.js +2 -2
- package/dist/cjs/plugins/no-useless-assign.js +2 -2
- package/dist/cjs/plugins/node/best-practices.js +2 -2
- package/dist/cjs/plugins/node/errors.js +7 -7
- package/dist/cjs/plugins/node/index.js +5 -5
- package/dist/cjs/plugins/node/style.js +2 -2
- package/dist/cjs/plugins/optimize-regex.js +2 -2
- package/dist/cjs/plugins/prefer-object-spread.js +2 -2
- package/dist/cjs/plugins/promise.js +2 -2
- package/dist/cjs/plugins/react/base.js +5 -5
- package/dist/cjs/plugins/react/index.js +5 -5
- package/dist/cjs/plugins/react/jsx.js +6 -6
- package/dist/cjs/plugins/react-hooks.js +2 -2
- package/dist/cjs/plugins/react-native.js +2 -2
- package/dist/cjs/plugins/react-perf.js +2 -2
- package/dist/cjs/plugins/react-refresh.js +2 -2
- package/dist/cjs/plugins/security.js +2 -2
- package/dist/cjs/plugins/sort-keys-fix.js +3 -3
- package/dist/cjs/plugins/typescript.d.ts +7 -0
- package/dist/cjs/plugins/typescript.js +66 -43
- package/dist/cjs/plugins/unicorn.js +16 -16
- package/dist/cjs/rules.js +61 -61
- package/dist/cjs/settings.d.ts +1 -0
- package/dist/cjs/settings.js +3 -2
- package/dist/cjs/test/test-duplicate-import.js +1 -1
- package/package.json +18 -18
package/dist/cjs/index.js
CHANGED
|
@@ -4,7 +4,7 @@ module.exports = {
|
|
|
4
4
|
env: {
|
|
5
5
|
browser: true,
|
|
6
6
|
jasmine: true,
|
|
7
|
-
node: true
|
|
7
|
+
node: true,
|
|
8
8
|
},
|
|
9
9
|
extends: [
|
|
10
10
|
"./plugins/array-function",
|
|
@@ -39,7 +39,7 @@ module.exports = {
|
|
|
39
39
|
extraFileExtensions: [".mjs"],
|
|
40
40
|
project: "./tsconfig.json",
|
|
41
41
|
sourceType: "module",
|
|
42
|
-
tsconfigRootDir: "./"
|
|
42
|
+
tsconfigRootDir: "./",
|
|
43
43
|
},
|
|
44
|
-
plugins: ["@typescript-eslint"]
|
|
44
|
+
plugins: ["@typescript-eslint"],
|
|
45
45
|
};
|
|
@@ -7,5 +7,5 @@ exports.javascriptOverrides = void 0;
|
|
|
7
7
|
var typescript_1 = __importDefault(require("../plugins/typescript"));
|
|
8
8
|
exports.javascriptOverrides = {
|
|
9
9
|
files: ["*.js", "*.jsx", "*.mjs"],
|
|
10
|
-
rules: Object.fromEntries(Object.keys(typescript_1.default.rules).map(function (rule) { return [rule, "off"]; }))
|
|
10
|
+
rules: Object.fromEntries(Object.keys(typescript_1.default.rules).map(function (rule) { return [rule, "off"]; })),
|
|
11
11
|
};
|
|
@@ -17,6 +17,7 @@ exports.typescriptOverrides = {
|
|
|
17
17
|
"keyword-spacing": "off",
|
|
18
18
|
"lines-around-comment": "off",
|
|
19
19
|
"lines-between-class-members": "off",
|
|
20
|
+
"max-params": "off",
|
|
20
21
|
"no-duplicate-imports": "off",
|
|
21
22
|
"no-empty-function": "off",
|
|
22
23
|
"no-extra-parens": "off",
|
|
@@ -33,11 +34,12 @@ exports.typescriptOverrides = {
|
|
|
33
34
|
"no-use-before-define": "off",
|
|
34
35
|
"object-curly-spacing": "off",
|
|
35
36
|
"padding-line-between-statements": "off",
|
|
37
|
+
"prefer-destructuring": "off",
|
|
36
38
|
quotes: "off",
|
|
37
39
|
"require-await": "off",
|
|
38
40
|
semi: "off",
|
|
39
41
|
"space-before-blocks": "off",
|
|
40
42
|
"space-before-function-paren": "off",
|
|
41
|
-
"space-infix-ops": "off"
|
|
42
|
-
}
|
|
43
|
+
"space-infix-ops": "off",
|
|
44
|
+
},
|
|
43
45
|
};
|
|
@@ -8,8 +8,8 @@ var fs_1 = require("fs");
|
|
|
8
8
|
var settings = {
|
|
9
9
|
"format-message": {
|
|
10
10
|
generateId: "normalized",
|
|
11
|
-
sourceLocale: "en-US"
|
|
12
|
-
}
|
|
11
|
+
sourceLocale: "en-US",
|
|
12
|
+
},
|
|
13
13
|
};
|
|
14
14
|
if ((0, fs_1.existsSync)("locale")) {
|
|
15
15
|
settings["format-message"].locale = "./locale";
|
|
@@ -112,7 +112,7 @@ module.exports = {
|
|
|
112
112
|
"format-message/no-missing-params": [
|
|
113
113
|
"error",
|
|
114
114
|
{
|
|
115
|
-
allowNonLiteral: false
|
|
115
|
+
allowNonLiteral: false,
|
|
116
116
|
}
|
|
117
117
|
],
|
|
118
118
|
/*
|
|
@@ -145,7 +145,7 @@ module.exports = {
|
|
|
145
145
|
*
|
|
146
146
|
* https://www.npmjs.com/package/eslint-plugin-format-message#translation-match-params
|
|
147
147
|
*/
|
|
148
|
-
"format-message/translation-match-params": "error"
|
|
148
|
+
"format-message/translation-match-params": "error",
|
|
149
149
|
},
|
|
150
|
-
settings: settings
|
|
150
|
+
settings: settings,
|
|
151
151
|
};
|
|
@@ -24,7 +24,7 @@ module.exports = {
|
|
|
24
24
|
"@typescript-eslint/parser": [
|
|
25
25
|
".ts",
|
|
26
26
|
".tsx"
|
|
27
|
-
]
|
|
27
|
+
],
|
|
28
28
|
},
|
|
29
29
|
"import/resolver": {
|
|
30
30
|
node: {
|
|
@@ -33,11 +33,11 @@ module.exports = {
|
|
|
33
33
|
".jsx",
|
|
34
34
|
".ts",
|
|
35
35
|
".tsx"
|
|
36
|
-
]
|
|
36
|
+
],
|
|
37
37
|
},
|
|
38
38
|
typescript: {
|
|
39
|
-
project: "."
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
39
|
+
project: ".",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
43
|
};
|
|
@@ -72,7 +72,7 @@ module.exports = {
|
|
|
72
72
|
"import/max-dependencies": [
|
|
73
73
|
"error",
|
|
74
74
|
{
|
|
75
|
-
max: 25
|
|
75
|
+
max: 25,
|
|
76
76
|
}
|
|
77
77
|
],
|
|
78
78
|
/*
|
|
@@ -89,7 +89,7 @@ module.exports = {
|
|
|
89
89
|
"import/no-anonymous-default-export": [
|
|
90
90
|
"error",
|
|
91
91
|
{
|
|
92
|
-
allowObject: true
|
|
92
|
+
allowObject: true,
|
|
93
93
|
}
|
|
94
94
|
],
|
|
95
95
|
/*
|
|
@@ -148,7 +148,7 @@ module.exports = {
|
|
|
148
148
|
"regenerator-runtime/runtime",
|
|
149
149
|
"**/*.scss",
|
|
150
150
|
"**/*.css"
|
|
151
|
-
]
|
|
151
|
+
],
|
|
152
152
|
}
|
|
153
153
|
],
|
|
154
154
|
/*
|
|
@@ -173,10 +173,10 @@ module.exports = {
|
|
|
173
173
|
pathGroups: [
|
|
174
174
|
{
|
|
175
175
|
group: "internal",
|
|
176
|
-
pattern: "@src/**"
|
|
176
|
+
pattern: "@src/**",
|
|
177
177
|
}
|
|
178
178
|
],
|
|
179
|
-
pathGroupsExcludedImportTypes: ["builtin"]
|
|
179
|
+
pathGroupsExcludedImportTypes: ["builtin"],
|
|
180
180
|
}
|
|
181
181
|
],
|
|
182
182
|
/*
|
|
@@ -186,6 +186,6 @@ module.exports = {
|
|
|
186
186
|
*
|
|
187
187
|
* https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/prefer-default-export.md
|
|
188
188
|
*/
|
|
189
|
-
"import/prefer-default-export": "off"
|
|
190
|
-
}
|
|
189
|
+
"import/prefer-default-export": "off",
|
|
190
|
+
},
|
|
191
191
|
};
|
package/dist/cjs/plugins/more.js
CHANGED
|
@@ -55,7 +55,7 @@ module.exports = {
|
|
|
55
55
|
"off",
|
|
56
56
|
{
|
|
57
57
|
resolvePaths: resolvePaths,
|
|
58
|
-
tryExtensions: tryExtensions
|
|
58
|
+
tryExtensions: tryExtensions,
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
61
|
/*
|
|
@@ -67,7 +67,7 @@ module.exports = {
|
|
|
67
67
|
"off",
|
|
68
68
|
{
|
|
69
69
|
resolvePaths: resolvePaths,
|
|
70
|
-
tryExtensions: tryExtensions
|
|
70
|
+
tryExtensions: tryExtensions,
|
|
71
71
|
}
|
|
72
72
|
],
|
|
73
73
|
/*
|
|
@@ -102,7 +102,7 @@ module.exports = {
|
|
|
102
102
|
"node/no-unpublished-import": [
|
|
103
103
|
"error",
|
|
104
104
|
{
|
|
105
|
-
allowModules: ["electron"]
|
|
105
|
+
allowModules: ["electron"],
|
|
106
106
|
}
|
|
107
107
|
],
|
|
108
108
|
/*
|
|
@@ -129,7 +129,7 @@ module.exports = {
|
|
|
129
129
|
"dynamicImport",
|
|
130
130
|
"modules"
|
|
131
131
|
],
|
|
132
|
-
version: settings_1.nodeVersion
|
|
132
|
+
version: settings_1.nodeVersion,
|
|
133
133
|
}
|
|
134
134
|
],
|
|
135
135
|
/*
|
|
@@ -141,7 +141,7 @@ module.exports = {
|
|
|
141
141
|
"error",
|
|
142
142
|
{
|
|
143
143
|
ignores: [],
|
|
144
|
-
version: settings_1.nodeVersion
|
|
144
|
+
version: settings_1.nodeVersion,
|
|
145
145
|
}
|
|
146
146
|
],
|
|
147
147
|
/*
|
|
@@ -155,6 +155,6 @@ module.exports = {
|
|
|
155
155
|
*
|
|
156
156
|
* https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/shebang.md
|
|
157
157
|
*/
|
|
158
|
-
"node/shebang": "error"
|
|
159
|
-
}
|
|
158
|
+
"node/shebang": "error",
|
|
159
|
+
},
|
|
160
160
|
};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
module.exports = {
|
|
8
8
|
env: {
|
|
9
|
-
node: true
|
|
9
|
+
node: true,
|
|
10
10
|
},
|
|
11
11
|
extends: [
|
|
12
12
|
"./best-practices",
|
|
@@ -24,12 +24,12 @@ module.exports = {
|
|
|
24
24
|
process: false,
|
|
25
25
|
Promise: false,
|
|
26
26
|
require: false,
|
|
27
|
-
System: false
|
|
27
|
+
System: false,
|
|
28
28
|
},
|
|
29
29
|
plugins: ["node"],
|
|
30
30
|
settings: {
|
|
31
31
|
node: {
|
|
32
|
-
allowModules: ["jasmine"]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
32
|
+
allowModules: ["jasmine"],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
35
|
};
|
|
@@ -33,7 +33,7 @@ module.exports = {
|
|
|
33
33
|
"error",
|
|
34
34
|
"always",
|
|
35
35
|
{
|
|
36
|
-
ignoreClassFields: true
|
|
36
|
+
ignoreClassFields: true,
|
|
37
37
|
}
|
|
38
38
|
],
|
|
39
39
|
/*
|
|
@@ -83,7 +83,7 @@ module.exports = {
|
|
|
83
83
|
"error",
|
|
84
84
|
{
|
|
85
85
|
namedComponents: "arrow-function",
|
|
86
|
-
unnamedComponents: "arrow-function"
|
|
86
|
+
unnamedComponents: "arrow-function",
|
|
87
87
|
}
|
|
88
88
|
],
|
|
89
89
|
/*
|
|
@@ -316,7 +316,7 @@ module.exports = {
|
|
|
316
316
|
"react/prefer-stateless-function": [
|
|
317
317
|
"error",
|
|
318
318
|
{
|
|
319
|
-
ignorePureComponents: true
|
|
319
|
+
ignorePureComponents: true,
|
|
320
320
|
}
|
|
321
321
|
],
|
|
322
322
|
/*
|
|
@@ -402,6 +402,6 @@ module.exports = {
|
|
|
402
402
|
*
|
|
403
403
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/void-dom-elements-no-children.md
|
|
404
404
|
*/
|
|
405
|
-
"react/void-dom-elements-no-children": "error"
|
|
406
|
-
}
|
|
405
|
+
"react/void-dom-elements-no-children": "error",
|
|
406
|
+
},
|
|
407
407
|
};
|
|
@@ -11,13 +11,13 @@ module.exports = {
|
|
|
11
11
|
].map(function (string) { return require.resolve(string); }),
|
|
12
12
|
parserOptions: {
|
|
13
13
|
ecmaFeatures: {
|
|
14
|
-
jsx: true
|
|
15
|
-
}
|
|
14
|
+
jsx: true,
|
|
15
|
+
},
|
|
16
16
|
},
|
|
17
17
|
plugins: ["react"],
|
|
18
18
|
settings: {
|
|
19
19
|
react: {
|
|
20
|
-
version: "detect"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
20
|
+
version: "detect",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
23
|
};
|
|
@@ -52,7 +52,7 @@ module.exports = {
|
|
|
52
52
|
"react/jsx-curly-spacing": [
|
|
53
53
|
"error",
|
|
54
54
|
{
|
|
55
|
-
when: "always"
|
|
55
|
+
when: "always",
|
|
56
56
|
}
|
|
57
57
|
],
|
|
58
58
|
/*
|
|
@@ -74,7 +74,7 @@ module.exports = {
|
|
|
74
74
|
".jsx",
|
|
75
75
|
".ts",
|
|
76
76
|
".tsx"
|
|
77
|
-
]
|
|
77
|
+
],
|
|
78
78
|
}
|
|
79
79
|
],
|
|
80
80
|
/*
|
|
@@ -124,7 +124,7 @@ module.exports = {
|
|
|
124
124
|
"react/jsx-max-depth": [
|
|
125
125
|
"error",
|
|
126
126
|
{
|
|
127
|
-
max: 10
|
|
127
|
+
max: 10,
|
|
128
128
|
}
|
|
129
129
|
],
|
|
130
130
|
/*
|
|
@@ -243,7 +243,7 @@ module.exports = {
|
|
|
243
243
|
"react/jsx-sort-props": [
|
|
244
244
|
"error",
|
|
245
245
|
{
|
|
246
|
-
ignoreCase: true
|
|
246
|
+
ignoreCase: true,
|
|
247
247
|
}
|
|
248
248
|
],
|
|
249
249
|
/*
|
|
@@ -269,6 +269,6 @@ module.exports = {
|
|
|
269
269
|
*
|
|
270
270
|
* https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-wrap-multilines.md
|
|
271
271
|
*/
|
|
272
|
-
"react/jsx-wrap-multilines": "error"
|
|
273
|
-
}
|
|
272
|
+
"react/jsx-wrap-multilines": "error",
|
|
273
|
+
},
|
|
274
274
|
};
|
|
@@ -52,6 +52,6 @@ module.exports = {
|
|
|
52
52
|
*
|
|
53
53
|
* https://github.com/intellicode/eslint-plugin-react-native/blob/HEAD/docs/rules/split-platform-components.md
|
|
54
54
|
*/
|
|
55
|
-
"react-native/split-platform-components": "off"
|
|
56
|
-
}
|
|
55
|
+
"react-native/split-platform-components": "off",
|
|
56
|
+
},
|
|
57
57
|
};
|