@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.
Files changed (51) hide show
  1. package/dist/cjs/index.js +3 -3
  2. package/dist/cjs/overrides/javascript.js +1 -1
  3. package/dist/cjs/overrides/typescript.js +4 -2
  4. package/dist/cjs/plugins/array-function.js +2 -2
  5. package/dist/cjs/plugins/es/es2015.js +2 -2
  6. package/dist/cjs/plugins/es/es2016.js +2 -2
  7. package/dist/cjs/plugins/es/es2017.js +2 -2
  8. package/dist/cjs/plugins/es/es2018.js +2 -2
  9. package/dist/cjs/plugins/es/es2019.js +2 -2
  10. package/dist/cjs/plugins/es/es2020.js +2 -2
  11. package/dist/cjs/plugins/es/es2021.js +2 -2
  12. package/dist/cjs/plugins/es/es5.js +2 -2
  13. package/dist/cjs/plugins/es/index.js +1 -1
  14. package/dist/cjs/plugins/eslint-comments/best-practices.js +3 -3
  15. package/dist/cjs/plugins/eslint-comments/index.js +1 -1
  16. package/dist/cjs/plugins/eslint-comments/style.js +2 -2
  17. package/dist/cjs/plugins/filenames.js +2 -2
  18. package/dist/cjs/plugins/format-message.js +5 -5
  19. package/dist/cjs/plugins/import/index.js +6 -6
  20. package/dist/cjs/plugins/import/module-systems.js +2 -2
  21. package/dist/cjs/plugins/import/static-analysis.js +2 -2
  22. package/dist/cjs/plugins/import/style.js +7 -7
  23. package/dist/cjs/plugins/import/warnings.js +2 -2
  24. package/dist/cjs/plugins/import-newlines.js +3 -3
  25. package/dist/cjs/plugins/more.js +2 -2
  26. package/dist/cjs/plugins/no-unsanitized.js +2 -2
  27. package/dist/cjs/plugins/no-useless-assign.js +2 -2
  28. package/dist/cjs/plugins/node/best-practices.js +2 -2
  29. package/dist/cjs/plugins/node/errors.js +7 -7
  30. package/dist/cjs/plugins/node/index.js +5 -5
  31. package/dist/cjs/plugins/node/style.js +2 -2
  32. package/dist/cjs/plugins/optimize-regex.js +2 -2
  33. package/dist/cjs/plugins/prefer-object-spread.js +2 -2
  34. package/dist/cjs/plugins/promise.js +2 -2
  35. package/dist/cjs/plugins/react/base.js +5 -5
  36. package/dist/cjs/plugins/react/index.js +5 -5
  37. package/dist/cjs/plugins/react/jsx.js +6 -6
  38. package/dist/cjs/plugins/react-hooks.js +2 -2
  39. package/dist/cjs/plugins/react-native.js +2 -2
  40. package/dist/cjs/plugins/react-perf.js +2 -2
  41. package/dist/cjs/plugins/react-refresh.js +2 -2
  42. package/dist/cjs/plugins/security.js +2 -2
  43. package/dist/cjs/plugins/sort-keys-fix.js +3 -3
  44. package/dist/cjs/plugins/typescript.d.ts +7 -0
  45. package/dist/cjs/plugins/typescript.js +66 -43
  46. package/dist/cjs/plugins/unicorn.js +16 -16
  47. package/dist/cjs/rules.js +61 -61
  48. package/dist/cjs/settings.d.ts +1 -0
  49. package/dist/cjs/settings.js +3 -2
  50. package/dist/cjs/test/test-duplicate-import.js +1 -1
  51. 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
  };
@@ -49,6 +49,6 @@ module.exports = {
49
49
  *
50
50
  * https://www.npmjs.com/package/eslint-plugin-array-func#prefer-flat-map
51
51
  */
52
- "array-func/prefer-flat-map": "error"
53
- }
52
+ "array-func/prefer-flat-map": "error",
53
+ },
54
54
  };
@@ -395,6 +395,6 @@ module.exports = {
395
395
  *
396
396
  * https://eslint-plugin-es.mysticatea.dev/rules/no-weak-set.html
397
397
  */
398
- "es/no-weak-set": "off"
399
- }
398
+ "es/no-weak-set": "off",
399
+ },
400
400
  };
@@ -11,6 +11,6 @@ module.exports = {
11
11
  *
12
12
  * https://eslint-plugin-es.mysticatea.dev/rules/no-exponential-operators.html
13
13
  */
14
- "es/no-exponential-operators": "off"
15
- }
14
+ "es/no-exponential-operators": "off",
15
+ },
16
16
  };
@@ -47,6 +47,6 @@ module.exports = {
47
47
  *
48
48
  * https://eslint-plugin-es.mysticatea.dev/rules/no-trailing-function-commas.html
49
49
  */
50
- "es/no-trailing-function-commas": "off"
51
- }
50
+ "es/no-trailing-function-commas": "off",
51
+ },
52
52
  };
@@ -47,6 +47,6 @@ module.exports = {
47
47
  *
48
48
  * https://eslint-plugin-es.mysticatea.dev/rules/no-rest-spread-properties.html
49
49
  */
50
- "es/no-rest-spread-properties": "off"
51
- }
50
+ "es/no-rest-spread-properties": "off",
51
+ },
52
52
  };
@@ -29,6 +29,6 @@ module.exports = {
29
29
  *
30
30
  * https://eslint-plugin-es.mysticatea.dev/rules/no-regexp-unicode-property-escapes-2019.html
31
31
  */
32
- "es/no-regexp-unicode-property-escapes-2019": "off"
33
- }
32
+ "es/no-regexp-unicode-property-escapes-2019": "off",
33
+ },
34
34
  };
@@ -53,6 +53,6 @@ module.exports = {
53
53
  *
54
54
  * https://eslint-plugin-es.mysticatea.dev/rules/no-promise-all-settled.html
55
55
  */
56
- "es/no-promise-all-settled": "off"
57
- }
56
+ "es/no-promise-all-settled": "off",
57
+ },
58
58
  };
@@ -29,6 +29,6 @@ module.exports = {
29
29
  *
30
30
  * https://eslint-plugin-es.mysticatea.dev/rules/no-weakrefs.html
31
31
  */
32
- "es/no-weakrefs": "off"
33
- }
32
+ "es/no-weakrefs": "off",
33
+ },
34
34
  };
@@ -113,6 +113,6 @@ module.exports = {
113
113
  *
114
114
  * https://eslint-plugin-es.mysticatea.dev/rules/no-trailing-commas.html
115
115
  */
116
- "es/no-trailing-commas": "off"
117
- }
116
+ "es/no-trailing-commas": "off",
117
+ },
118
118
  };
@@ -15,5 +15,5 @@ module.exports = {
15
15
  "./es2020",
16
16
  "./es2021"
17
17
  ].map(function (string) { return require.resolve(string); }),
18
- plugins: ["es"]
18
+ plugins: ["es"],
19
19
  };
@@ -53,8 +53,8 @@ module.exports = {
53
53
  {
54
54
  ignore: [
55
55
  "eslint-enable"
56
- ]
56
+ ],
57
57
  }
58
- ]
59
- }
58
+ ],
59
+ },
60
60
  };
@@ -10,5 +10,5 @@ module.exports = {
10
10
  "./best-practices",
11
11
  "./style"
12
12
  ].map(function (string) { return require.resolve(string); }),
13
- plugins: ["eslint-comments"]
13
+ plugins: ["eslint-comments"],
14
14
  };
@@ -20,6 +20,6 @@ module.exports = {
20
20
  *
21
21
  * https://mysticatea.github.io/eslint-plugin-eslint-comments/rules/no-use.html
22
22
  */
23
- "eslint-comments/no-use": "off"
24
- }
23
+ "eslint-comments/no-use": "off",
24
+ },
25
25
  };
@@ -43,6 +43,6 @@ module.exports = {
43
43
  *
44
44
  * https://www.npmjs.com/package/eslint-plugin-filenames#dont-allow-indexjs-files-no-index
45
45
  */
46
- "filenames/no-index": "off"
47
- }
46
+ "filenames/no-index": "off",
47
+ },
48
48
  };
@@ -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
  };
@@ -38,6 +38,6 @@ module.exports = {
38
38
  *
39
39
  * https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/unambiguous.md
40
40
  */
41
- "import/unambiguous": "error"
42
- }
41
+ "import/unambiguous": "error",
42
+ },
43
43
  };
@@ -108,6 +108,6 @@ module.exports = {
108
108
  *
109
109
  * https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/no-webpack-loader-syntax.md
110
110
  */
111
- "import/no-webpack-loader-syntax": "error"
112
- }
111
+ "import/no-webpack-loader-syntax": "error",
112
+ },
113
113
  };
@@ -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
  };
@@ -50,6 +50,6 @@ module.exports = {
50
50
  *
51
51
  * https://github.com/benmosher/eslint-plugin-import/blob/HEAD/docs/rules/no-named-as-default-member.md
52
52
  */
53
- "import/no-named-as-default-member": "error"
54
- }
53
+ "import/no-named-as-default-member": "error",
54
+ },
55
55
  };
@@ -17,8 +17,8 @@ module.exports = {
17
17
  {
18
18
  items: 1,
19
19
  "max-len": Number.POSITIVE_INFINITY,
20
- semi: true
20
+ semi: true,
21
21
  }
22
- ]
23
- }
22
+ ],
23
+ },
24
24
  };
@@ -89,6 +89,6 @@ module.exports = {
89
89
  *
90
90
  * https://github.com/WebbyLab/eslint-plugin-more/blob/HEAD/docs/prefer-includes.md
91
91
  */
92
- "more/prefer-includes": "off"
93
- }
92
+ "more/prefer-includes": "off",
93
+ },
94
94
  };
@@ -30,6 +30,6 @@ module.exports = {
30
30
  *
31
31
  * https://github.com/mozilla/eslint-plugin-no-unsanitized/blob/master/docs/rules/property.md
32
32
  */
33
- "no-unsanitized/property": "error"
34
- }
33
+ "no-unsanitized/property": "error",
34
+ },
35
35
  };
@@ -12,6 +12,6 @@ module.exports = {
12
12
  *
13
13
  * https://www.npmjs.com/package/eslint-plugin-no-useless-assign#usage
14
14
  */
15
- "no-useless-assign/no-useless-assign": "error"
16
- }
15
+ "no-useless-assign/no-useless-assign": "error",
16
+ },
17
17
  };
@@ -11,6 +11,6 @@ module.exports = {
11
11
  *
12
12
  * https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md
13
13
  */
14
- "node/no-deprecated-api": "error"
15
- }
14
+ "node/no-deprecated-api": "error",
15
+ },
16
16
  };
@@ -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
  };
@@ -137,6 +137,6 @@ module.exports = {
137
137
  *
138
138
  * https://github.com/mysticatea/eslint-plugin-node/blob/HEAD/docs/rules/prefer-promises/fs.md
139
139
  */
140
- "node/prefer-promises/fs": "error"
141
- }
140
+ "node/prefer-promises/fs": "error",
141
+ },
142
142
  };
@@ -15,6 +15,6 @@ module.exports = {
15
15
  *
16
16
  * https://github.com/BrainMaestro/eslint-plugin-optimize-regex#usage
17
17
  */
18
- "optimize-regex/optimize-regex": "off"
19
- }
18
+ "optimize-regex/optimize-regex": "off",
19
+ },
20
20
  };
@@ -17,6 +17,6 @@ module.exports = {
17
17
  *
18
18
  * https://www.npmjs.com/package/eslint-plugin-prefer-object-spread#usage
19
19
  */
20
- "prefer-object-spread/prefer-object-spread": "error"
21
- }
20
+ "prefer-object-spread/prefer-object-spread": "error",
21
+ },
22
22
  };
@@ -104,6 +104,6 @@ module.exports = {
104
104
  *
105
105
  * https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/valid-params.md
106
106
  */
107
- "promise/valid-params": "error"
108
- }
107
+ "promise/valid-params": "error",
108
+ },
109
109
  };
@@ -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
  };
@@ -22,6 +22,6 @@ module.exports = {
22
22
  *
23
23
  * https://reactjs.org/docs/hooks-rules.html
24
24
  */
25
- "react-hooks/rules-of-hooks": "error"
26
- }
25
+ "react-hooks/rules-of-hooks": "error",
26
+ },
27
27
  };
@@ -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
  };
@@ -39,6 +39,6 @@ module.exports = {
39
39
  *
40
40
  * https://github.com/cvazac/eslint-plugin-react-perf/blob/HEAD/docs/rules/jsx-no-new-object-as-prop.md
41
41
  */
42
- "react-perf/jsx-no-new-object-as-prop": "off"
43
- }
42
+ "react-perf/jsx-no-new-object-as-prop": "off",
43
+ },
44
44
  };
@@ -12,6 +12,6 @@ module.exports = {
12
12
  *
13
13
  * https://github.com/ArnaudBarre/eslint-plugin-react-refresh#usage
14
14
  */
15
- "react-refresh/only-export-components": "error"
16
- }
15
+ "react-refresh/only-export-components": "error",
16
+ },
17
17
  };
@@ -105,6 +105,6 @@ module.exports = {
105
105
  *
106
106
  * https://blog.liftsecurity.io/2014/11/03/regular-expression-dos-and-node.js
107
107
  */
108
- "security/detect-unsafe-regex": "error"
109
- }
108
+ "security/detect-unsafe-regex": "error",
109
+ },
110
110
  };