@arcgis/eslint-config 4.32.0-next.75 → 4.32.0-next.76

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.
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "4.32.0-next.75";
2
+ var version = "4.32.0-next.76";
3
3
 
4
4
  // src/plugins/utils/makePlugin.ts
5
5
  function makeEslintPlugin(pluginName, rules) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  makeEslintPlugin
3
- } from "./chunk-7G6OXZK7.js";
3
+ } from "./chunk-CXLY7EQM.js";
4
4
 
5
5
  // src/plugins/lumina/rules/add-missing-jsx-import.ts
6
6
  import { AST_NODE_TYPES as AST_NODE_TYPES2 } from "@typescript-eslint/utils";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  makeEslintPlugin
3
- } from "./chunk-7G6OXZK7.js";
3
+ } from "./chunk-CXLY7EQM.js";
4
4
 
5
5
  // src/plugins/webgis/utils/creator.ts
6
6
  import { ESLintUtils } from "@typescript-eslint/utils";
@@ -3,8 +3,8 @@ import {
3
3
  } from "../chunk-WAWBOPY7.js";
4
4
  import {
5
5
  webgis_default
6
- } from "../chunk-LVYAWX7T.js";
7
- import "../chunk-7G6OXZK7.js";
6
+ } from "../chunk-Y7ZXXVWO.js";
7
+ import "../chunk-CXLY7EQM.js";
8
8
 
9
9
  // src/config/index.ts
10
10
  import eslint from "@eslint/js";
@@ -37,13 +37,13 @@ var config_default = [
37
37
  sourceType: "module"
38
38
  },
39
39
  rules: {
40
+ //#region Disable rules redundant with Typescript
40
41
  /**
41
- *
42
42
  * The following rules are disabled because they are redundant with
43
43
  * TypeScript. No need to needlessly slow down ESLint and clutter the
44
44
  * error messages.
45
- *
46
45
  */
46
+ // TypeScript reports this
47
47
  "no-unused-labels": "off",
48
48
  "@typescript-eslint/no-unused-vars": [
49
49
  "off",
@@ -59,27 +59,58 @@ var config_default = [
59
59
  ],
60
60
  // Redundant with TypeScript, but has autofix, so enabled for convenience
61
61
  "no-unsafe-negation": "warn",
62
+ // TypeScript reports this
62
63
  "no-unused-private-class-members": "off",
64
+ // TypeScript detects re-declarations like this
65
+ "no-case-declarations": "off",
66
+ // Narrow use case. Even less with TypeScript
67
+ "no-ex-assign": "off",
68
+ // Redundant with no-restricted-globals and with TypeScript
69
+ "no-global-assign": "off",
70
+ // Redundant with prefer-regex-literals, which enforces regex literal
71
+ // syntax, which is checked by TypeScript
72
+ "no-invalid-regexp": "off",
73
+ // TypeScript reports this as syntax error
74
+ "no-nonoctal-decimal-escape": "off",
75
+ // TypeScript reports this as syntax error
76
+ "no-octal": "off",
77
+ // TypeScript reports this as type error
78
+ "no-unsafe-optional-chaining": "off",
79
+ // TypeScript emits an error for with() statements
80
+ "no-with": "off",
81
+ // TypeScript reports this as a type error
82
+ "valid-typeof": "off",
83
+ // TypeScript reports this
84
+ "@typescript-eslint/prefer-namespace-keyword": "off",
85
+ //#endregion
86
+ //#region Disable rules Redundant with Prettier
63
87
  /**
64
- *
65
88
  * The following rules are redundant with Prettier
66
- *
67
89
  */
68
90
  "no-unexpected-multiline": "off",
91
+ // Outside of comments, this is redundant with Prettier.
92
+ // In comments, it is not an issue since comments are stripped in minified
93
+ // builds
94
+ "no-irregular-whitespace": "off",
95
+ //#endregion
96
+ //#region Disable obsolete rules
69
97
  /**
70
- *
71
98
  * Obsolete rules (rules that enforced constraints that are no longer
72
99
  * present in the language, or that are no longer relevant)
73
- *
74
100
  */
75
101
  // Namespaces are needed for defining custom elements
76
102
  "@typescript-eslint/no-namespace": "off",
77
103
  // A lot of false positives when dealing with Arcade
78
104
  "no-template-curly-in-string": "off",
105
+ // We don't use TSLint
106
+ "@typescript-eslint/ban-tslint-comment": "off",
107
+ //#endregion
108
+ //#region Disable rules that were moved to extra config
79
109
  /**
80
110
  *
81
111
  * The following default rules are disabled in favor of moving them into the
82
- * @arcgis/eslint-config/extra due to huge number of false positives
112
+ * @arcgis/eslint-config/extra due to huge number of false positives or
113
+ * performance issues.
83
114
  *
84
115
  */
85
116
  // Disabled as per https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/446#discussioncomment-3166
@@ -95,6 +126,8 @@ var config_default = [
95
126
  * type
96
127
  */
97
128
  "@typescript-eslint/no-useless-constructor": "off",
129
+ //#endregion
130
+ //#region Detect possible bugs
98
131
  /**
99
132
  *
100
133
  * The following rules report what is a possible bug. If you are sure that the
@@ -114,11 +147,8 @@ var config_default = [
114
147
  // with TypeScript in some cases, but it provides a less-confusing error
115
148
  // message (for example in .reduce())
116
149
  "array-callback-return": "warn",
117
- "no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
118
- "no-div-regex": "error",
119
150
  // Good rule to have, but many false positives, so only a warning
120
151
  "require-atomic-updates": "warn",
121
- "func-name-matching": ["warn", { considerPropertyDescriptor: true }],
122
152
  "grouped-accessor-pairs": "error",
123
153
  "no-extra-bind": "warn",
124
154
  "no-multi-assign": "error",
@@ -235,8 +265,6 @@ var config_default = [
235
265
  // "no-console": 'error',
236
266
  "no-eval": "error",
237
267
  "no-extend-native": "error",
238
- "no-iterator": "error",
239
- "no-proto": "error",
240
268
  "@typescript-eslint/no-restricted-imports": [
241
269
  "error",
242
270
  {
@@ -263,6 +291,9 @@ var config_default = [
263
291
  ignoreVoidOperator: true
264
292
  }
265
293
  ],
294
+ // Conflicts with @typescript-eslint/no-confusing-void-expression
295
+ // See https://github.com/typescript-eslint/typescript-eslint/issues/4507
296
+ "@typescript-eslint/no-meaningless-void-operator": "off",
266
297
  "@typescript-eslint/no-empty-function": [
267
298
  // There can be use cases for this (when providing a callback is required
268
299
  // but you don't want to do anything)
@@ -277,12 +308,18 @@ var config_default = [
277
308
  "func-style": ["error", "declaration", { allowArrowFunctions: true }],
278
309
  "no-new-func": "error",
279
310
  "no-new-wrappers": "error",
280
- "no-octal-escape": "error",
311
+ "@typescript-eslint/no-misused-promises": [
312
+ "warn",
313
+ {
314
+ // Redundant with TypeScript
315
+ checksSpreads: false
316
+ }
317
+ ],
318
+ //#endregion
319
+ //#region Report consistency issues
281
320
  // TODO: make these more or less strict as needed
282
321
  /**
283
- *
284
322
  * Consistency and clean code rules
285
- *
286
323
  */
287
324
  "arrow-body-style": "warn",
288
325
  // This rule is a good idea, but not autofixable, so is only a warning
@@ -444,7 +481,8 @@ var config_default = [
444
481
  "@typescript-eslint/consistent-type-exports": ["warn", { fixMixedExportsWithInlineTypeSpecifier: true }],
445
482
  "@typescript-eslint/consistent-type-imports": "warn",
446
483
  "default-param-last": "off",
447
- "@typescript-eslint/default-param-last": "warn",
484
+ // `undefined` can also be used to trigger default value
485
+ "@typescript-eslint/default-param-last": "off",
448
486
  "@typescript-eslint/explicit-function-return-type": [
449
487
  // Providing explicit type improves type-checking performance and
450
488
  // catches bugs (when actual return type is not what you are expecting,
@@ -459,9 +497,9 @@ var config_default = [
459
497
  ],
460
498
  "max-params": "off",
461
499
  // Two spaces is more readable than " {2}"
462
- "no-regex-spaces": ["off"],
463
- "prefer-const": ["warn"],
464
- "no-var": ["warn"],
500
+ "no-regex-spaces": "off",
501
+ "prefer-const": "warn",
502
+ "no-var": "error",
465
503
  // Prefer passing parameters as an object instead to be less error prone
466
504
  // and make adding/removing properties require less refactoring
467
505
  "@typescript-eslint/max-params": ["warn", { max: 5 }],
@@ -471,7 +509,6 @@ var config_default = [
471
509
  "@typescript-eslint/non-nullable-type-assertion-style": ["warn"],
472
510
  "@typescript-eslint/dot-notation": "warn",
473
511
  "@typescript-eslint/prefer-function-type": ["warn"],
474
- "@typescript-eslint/prefer-namespace-keyword": ["warn"],
475
512
  "@typescript-eslint/prefer-optional-chain": ["warn"],
476
513
  "@typescript-eslint/prefer-string-starts-ends-with": ["warn"],
477
514
  "@typescript-eslint/no-array-constructor": ["warn"],
@@ -574,6 +611,7 @@ var config_default = [
574
611
  // reports when component tries to emit an event that is marked as
575
612
  // deprecated.
576
613
  "@typescript-eslint/no-deprecated": "warn"
614
+ //#endregion
577
615
  // TODO: go over https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting
578
616
  }
579
617
  },
@@ -3,8 +3,8 @@ import {
3
3
  } from "../chunk-WAWBOPY7.js";
4
4
  import {
5
5
  lumina_default
6
- } from "../chunk-2NFXJSOF.js";
7
- import "../chunk-7G6OXZK7.js";
6
+ } from "../chunk-PXSYKWKU.js";
7
+ import "../chunk-CXLY7EQM.js";
8
8
 
9
9
  // src/config/storybook.ts
10
10
  import eslintPluginStorybook from "eslint-plugin-storybook";
@@ -12,9 +12,18 @@ var storybookConfig = [
12
12
  {
13
13
  ignores: ["**/storybook-static*"]
14
14
  },
15
- ...eslintPluginStorybook.configs["flat/recommended"],
16
- ...eslintPluginStorybook.configs["flat/addon-interactions"],
17
- ...eslintPluginStorybook.configs["flat/csf-strict"],
15
+ ...eslintPluginStorybook.configs["flat/recommended"].map((config) => ({
16
+ ...config,
17
+ files: ["**/*.stories.@(ts|tsx)"]
18
+ })),
19
+ ...eslintPluginStorybook.configs["flat/addon-interactions"].map((config) => ({
20
+ ...config,
21
+ files: ["**/*.stories.@(ts|tsx)"]
22
+ })),
23
+ ...eslintPluginStorybook.configs["flat/csf-strict"].map((config) => ({
24
+ ...config,
25
+ files: ["**/*.stories.@(ts|tsx)"]
26
+ })),
18
27
  {
19
28
  files: ["**/*.stories.@(ts|tsx)"],
20
29
  rules: {
@@ -22,14 +31,16 @@ var storybookConfig = [
22
31
  "storybook/await-interactions": "off",
23
32
  // Not applicable in our web-component setup
24
33
  "storybook/csf-component": "off",
25
- // We don't have deprecated usages
34
+ // This rule is for detecting usages of deprecated feature that we don't use
26
35
  "storybook/hierarchy-separator": "off",
27
36
  // Not applicable in our web-component setup
28
37
  "storybook/no-title-property-in-meta": "off",
29
38
  // Not applicable as we have a central Storybook config (@arcgis/storybook-utils)
30
39
  "storybook/no-uninstalled-addons": "off",
31
40
  // We never used storiesOf, and it's no longer included in Storybook
32
- "storybook/no-stories-of": "off"
41
+ "storybook/no-stories-of": "off",
42
+ // Redundant with TypeScript
43
+ "storybook/context-in-play-function": "off"
33
44
  }
34
45
  }
35
46
  ];
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  lumina_default
3
- } from "../../chunk-2NFXJSOF.js";
4
- import "../../chunk-7G6OXZK7.js";
3
+ } from "../../chunk-PXSYKWKU.js";
4
+ import "../../chunk-CXLY7EQM.js";
5
5
  export {
6
6
  lumina_default as default
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  webgis_default
3
- } from "../../chunk-LVYAWX7T.js";
4
- import "../../chunk-7G6OXZK7.js";
3
+ } from "../../chunk-Y7ZXXVWO.js";
4
+ import "../../chunk-CXLY7EQM.js";
5
5
  export {
6
6
  webgis_default as default
7
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/eslint-config",
3
- "version": "4.32.0-next.75",
3
+ "version": "4.32.0-next.76",
4
4
  "description": "ESLint configuration for arcgis-web-components",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -20,7 +20,7 @@
20
20
  ],
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "dependencies": {
23
- "@arcgis/components-utils": "4.32.0-next.75",
23
+ "@arcgis/components-utils": "4.32.0-next.76",
24
24
  "@eslint/js": "^9.17.0",
25
25
  "@types/confusing-browser-globals": "^1.0.3",
26
26
  "confusing-browser-globals": "^1.0.11",