@arcgis/eslint-config 5.2.0-next.29 → 5.2.0-next.30

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
  import { ESLintUtils } from "@typescript-eslint/utils";
2
- const version = "5.2.0-next.29";
2
+ const version = "5.2.0-next.30";
3
3
  const packageJson = {
4
4
  version
5
5
  };
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-PHj0Z_9J.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-CA5LDDI7.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";
@@ -226,7 +226,7 @@ function groupImportsByPath(imports, absImportPath, basePath) {
226
226
  });
227
227
  }
228
228
  function importStatementPathName(importStatement, absImportPath, basePath) {
229
- return importPathName(importStatementPathString(importStatement), absImportPath, basePath);
229
+ return normalizeImportPath(importPathName(importStatementPathString(importStatement), absImportPath, basePath));
230
230
  }
231
231
  function importStatementPathString(importStatement) {
232
232
  return importStatement.source.value;
@@ -248,10 +248,25 @@ function importPathName(importPath, absImportPath, basePath) {
248
248
  return path.dirname(relative(basePath, importPath));
249
249
  }
250
250
  function formatGroupedImports(sourceCode, groupedImports, newLine) {
251
- const importHeader = `// ${groupedImports.path.replace(/[\\/]/gu, ".")}`;
251
+ const importHeader = `// ${formatImportHeaderPath(groupedImports.path)}`;
252
252
  const imports = groupedImports.imports.map((importDeclaration) => sourceCode.getText(importDeclaration).trim()).join(newLine).trim();
253
253
  return `${importHeader}${newLine}${imports}`;
254
254
  }
255
+ function formatImportHeaderPath(importPath) {
256
+ return normalizeImportPath(importPath).replace(/[\\/]/gu, ".");
257
+ }
258
+ function normalizeImportPath(importPath) {
259
+ const parts = importPath.split(/[\\/]/gu);
260
+ if (parts[0] === "src") {
261
+ parts[0] = "esri";
262
+ } else if (parts[0] === "tests") {
263
+ const srcPart = parts.indexOf("src");
264
+ if (srcPart !== -1) {
265
+ parts[srcPart] = "esri";
266
+ }
267
+ }
268
+ return parts.join(path.sep);
269
+ }
255
270
  function getAttachedCommentStart(sourceCode, statement) {
256
271
  const comments = sourceCode.getCommentsBefore(statement);
257
272
  let start = statement.range[0];
@@ -452,7 +467,7 @@ function getDeclaredClass(filename) {
452
467
  if (!root) {
453
468
  return;
454
469
  }
455
- const relativePath = relative(root, filename).replaceAll(win32.sep, ".").replaceAll(posix.sep, ".").replace(/\.[^/.]+$/u, "");
470
+ const relativePath = relative(root, filename).replaceAll(win32.sep, ".").replaceAll(posix.sep, ".").replace(/^src\./u, "esri.").replace(/\.[^/.]+$/u, "");
456
471
  return relativePath;
457
472
  }
458
473
  const tsRe = /\.tsx?$/u;
@@ -694,7 +709,7 @@ function getToplevelSuiteName(filename) {
694
709
  return;
695
710
  }
696
711
  const relativePath = relative(root, filename).replaceAll(win32.sep, posix.sep);
697
- return relativePath.replace(/^tests\/(.*)\.spec\.ts/u, "$1");
712
+ return relativePath.replace(/^tests\/(.*)\.spec\.ts/u, "$1").replace("src/", "esri/");
698
713
  }
699
714
  const corePlugin = plugin.finalize();
700
715
  export {
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-PHj0Z_9J.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-CA5LDDI7.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-PHj0Z_9J.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-CA5LDDI7.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";
@@ -77,7 +77,8 @@ If you wish to use a loose type like any/object, create a type alias \`type {{ e
77
77
  return;
78
78
  }
79
79
  const extendsText = node.superClass ? context.sourceCode.getText(node.superClass) : "";
80
- const isCollectionClass = extendsText.includes("Collection.ofType") || extendsText.includes("(Collection)") || extendsText === "Collection" || extendsText === "OwningCollection" || context.filename.endsWith(`esri${path.sep}core${path.sep}Collection.ts`);
80
+ const isCollectionClass = extendsText.includes("Collection.ofType") || extendsText.includes("(Collection)") || extendsText === "Collection" || extendsText === "OwningCollection" || // TODO: drop the esri/ case once core is in the monorepo
81
+ context.filename.endsWith(`esri${path.sep}core${path.sep}Collection.ts`) || context.filename.endsWith(`src${path.sep}core${path.sep}Collection.ts`);
81
82
  if (isCollectionClass) {
82
83
  return;
83
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/eslint-config",
3
- "version": "5.2.0-next.29",
3
+ "version": "5.2.0-next.30",
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.2",
37
37
  "typescript-eslint": "^8.58.0",
38
- "@arcgis/toolkit": "5.2.0-next.29"
38
+ "@arcgis/toolkit": "5.2.0-next.30"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "eslint": "^10.2.0"