@arcgis/eslint-config 5.2.0-next.50 → 5.2.0-next.51

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.
@@ -28,8 +28,6 @@ const config = [
28
28
  "func-names": "off",
29
29
  // This rule is for consistency between library developers - less important for monolith apps.
30
30
  "id-denylist": "off",
31
- // Some cases actually require sequential async loops
32
- "no-await-in-loop": "off",
33
31
  // More important for library-exposed symbols than apps
34
32
  "symbol-description": "off"
35
33
  }
@@ -145,8 +145,10 @@ const config = [
145
145
  * consider refactoring to less confusing syntax instead
146
146
  *
147
147
  */
148
- // Might be intentional, so only a warning
149
- "no-await-in-loop": "warn",
148
+ // Too many false positives. Some cases require sequential execution of
149
+ // async code for correctness, cleaner output, or to avoid performance
150
+ // constraints
151
+ "no-await-in-loop": "off",
150
152
  "no-constructor-return": "warn",
151
153
  "no-fallthrough": ["error", { reportUnusedFallthroughComment: true }],
152
154
  // This mis-fires for anonymous functions when not wrapped in {}
@@ -464,7 +466,10 @@ const config = [
464
466
  // rule - give it more time to catch the bug cases. Also, this rule
465
467
  // changes runtime behavior, and may lead to breaking changes.
466
468
  "@typescript-eslint/no-useless-default-assignment": "off",
467
- "@typescript-eslint/no-unnecessary-type-assertion": ["warn"],
469
+ // Since https://devtopia.esri.com/WebGIS/arcgis-web-components/pull/17821,
470
+ // this rule has more true positives, but also many more false positives.
471
+ // The autofix often causes TypeScript errors, and new ESLint errors
472
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
468
473
  "@typescript-eslint/prefer-includes": ["warn"],
469
474
  "@typescript-eslint/prefer-reduce-type-parameter": ["warn"],
470
475
  "@typescript-eslint/prefer-return-this-type": ["warn"],
@@ -1,5 +1,5 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
- const version = "5.2.0-next.50";
2
+ const version = "5.2.0-next.51";
3
3
  const packageJson = {
4
4
  version
5
5
  };
@@ -1,7 +1,9 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-CI0e_JK0.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-DwtvWDJv.js";
2
2
  import { AST_NODE_TYPES, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
3
3
  import { generateDifferences, showInvisibles } from "prettier-linter-helpers";
4
4
  import path, { relative, win32, posix, normalize } from "path";
5
+ import { dirname, join } from "node:path";
6
+ import { existsSync } from "node:fs";
5
7
  import { execSync } from "child_process";
6
8
  const plugin = makeEslintPlugin(
7
9
  "core",
@@ -96,7 +98,7 @@ function removeTrailingBlankLines(text) {
96
98
  function findProjectRoot(filename) {
97
99
  const normalized = filename.replaceAll("\\", "/");
98
100
  let minimumIndex = Number.POSITIVE_INFINITY;
99
- for (const marker of ["src/", "tests/", "test-apps/", "esri/"]) {
101
+ for (const marker of ["src/", "tests/", "test-apps/", "esri/", ".github/"]) {
100
102
  const index = normalized.indexOf(marker);
101
103
  if (index === 0) {
102
104
  return ".";
@@ -104,7 +106,17 @@ function findProjectRoot(filename) {
104
106
  minimumIndex = Math.min(minimumIndex, index);
105
107
  }
106
108
  }
107
- return minimumIndex === Number.POSITIVE_INFINITY ? void 0 : normalized.slice(0, minimumIndex);
109
+ if (minimumIndex !== Number.POSITIVE_INFINITY) {
110
+ return normalized.slice(0, minimumIndex);
111
+ }
112
+ const fileToFind = "package.json";
113
+ for (let root = dirname(filename), previousRoot = filename; root !== previousRoot; previousRoot = root, root = dirname(root)) {
114
+ const filepath = join(root, fileToFind);
115
+ if (existsSync(filepath)) {
116
+ return root;
117
+ }
118
+ }
119
+ return;
108
120
  }
109
121
  const slashCharCode = 47;
110
122
  const isWindows = process.platform === "win32";
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-CI0e_JK0.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-DwtvWDJv.js";
2
2
  import { AST_NODE_TYPES, ESLintUtils, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
3
3
  import { l as luminaJsxExportName, a as luminaEntrypointName, b as luminaTestEntrypointName, s as sourceCodeDeclaresComponent, p as parsePropertyDecorator, c as getProperty, i as isGetterWithoutSetter, e as extractDeclareElementsInterface, d as isCreateEvent, h as hasDecorator, f as getName, j as checkForLuminaJsx, k as isBindThisCallee, g as getComponentDeclaration, u as unwrapExpression } from "../../estree-CDc-die8.js";
4
4
  import ts from "typescript";
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-CI0e_JK0.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-DwtvWDJv.js";
2
2
  import { TSESTree, AST_TOKEN_TYPES, AST_NODE_TYPES, TSESLint } from "@typescript-eslint/utils";
3
3
  import path from "node:path";
4
4
  import { resolve } from "path/posix";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/eslint-config",
3
- "version": "5.2.0-next.50",
3
+ "version": "5.2.0-next.51",
4
4
  "description": "ESLint configuration for WebGIS SDK",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,7 +35,7 @@
35
35
  "tslib": "^2.8.1",
36
36
  "typescript": "~6.0.3",
37
37
  "typescript-eslint": "^8.63.0",
38
- "@arcgis/toolkit": "5.2.0-next.50"
38
+ "@arcgis/toolkit": "5.2.0-next.51"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "eslint": "^10.6.0"