@arcgis/eslint-config 5.2.0-next.91 → 5.2.0-next.94

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.91";
2
+ const version = "5.2.0-next.93";
3
3
  const packageJson = {
4
4
  version
5
5
  };
@@ -0,0 +1,45 @@
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ const version = "5.2.0-next.94";
3
+ const packageJson = {
4
+ version
5
+ };
6
+ function makeEslintPlugin(pluginName, urlCreator) {
7
+ const rules = [];
8
+ const typeCheckedRules = /* @__PURE__ */ new Set();
9
+ const creator = ESLintUtils.RuleCreator(urlCreator);
10
+ return {
11
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
12
+ createRule(rule) {
13
+ const { meta, name, ...rest } = rule;
14
+ const docs = { ...meta.docs, name };
15
+ const ruleModule = creator({ ...rest, meta: { ...meta, docs }, name });
16
+ rules.push(ruleModule);
17
+ if (meta.docs.isTypeChecked) {
18
+ typeCheckedRules.add(`${pluginName}/${name}`);
19
+ }
20
+ return ruleModule;
21
+ },
22
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
23
+ finalize() {
24
+ const config = {
25
+ rules: Object.fromEntries(
26
+ rules.map((rule) => [`${pluginName}/${rule.meta.docs.name}`, rule.meta.docs.defaultLevel])
27
+ )
28
+ };
29
+ const plugin = {
30
+ meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version: packageJson.version, typeCheckedRules },
31
+ configs: {
32
+ recommended: config
33
+ },
34
+ rules: Object.fromEntries(rules.map((rule) => [rule.meta.docs.name, rule]))
35
+ };
36
+ config.plugins = {
37
+ [pluginName]: plugin
38
+ };
39
+ return plugin;
40
+ }
41
+ };
42
+ }
43
+ export {
44
+ makeEslintPlugin as m
45
+ };
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-ulmzVAh4.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-YJCQZcir.js";
2
2
  import { generateDifferences, showInvisibles } from "prettier-linter-helpers";
3
3
  import { AST_NODE_TYPES, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
4
4
  import path, { relative, win32, posix, normalize } from "path";
@@ -548,7 +548,7 @@ plugin.createRule({
548
548
  name: "prefer-relative-imports",
549
549
  meta: {
550
550
  docs: {
551
- description: "Checks that whenever possible import and export paths are relative instead of absolute.",
551
+ description: "Checks that whenever possible, import and export paths are relative instead of absolute.",
552
552
  defaultLevel: "error",
553
553
  isTypeChecked: false
554
554
  },
@@ -603,10 +603,13 @@ function pathRoot(p) {
603
603
  }
604
604
  }
605
605
  function verifyRelativeImport(context, node, absImportPath, basePath, importRoot) {
606
- const modulePath = node.value;
606
+ let modulePath = node.value;
607
607
  if (modulePath.startsWith(".")) {
608
608
  return;
609
609
  }
610
+ if (modulePath.startsWith("esri/")) {
611
+ modulePath = modulePath.replace("esri/", "src/");
612
+ }
610
613
  if (pathRoot(modulePath) === importRoot) {
611
614
  let relPath = path.relative(path.join(basePath, absImportPath), path.join(basePath, modulePath));
612
615
  if (!relPath.startsWith(".")) {
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-ulmzVAh4.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-YJCQZcir.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, g as getProperty, i as isGetterWithoutSetter, e as extractDeclareElementsInterface, c as isCreateEvent, h as hasDecorator, d as getName, f as checkForLuminaJsx, j as isBindThisCallee, k as getComponentDeclaration, u as unwrapExpression } from "../../estree-Ern7-L05.js";
4
4
  import ts from "typescript";
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-ulmzVAh4.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-YJCQZcir.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.91",
3
+ "version": "5.2.0-next.94",
4
4
  "description": "ESLint configuration for WebGIS SDK",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "license": "SEE LICENSE IN LICENSE.md",
23
23
  "dependencies": {
24
- "@arcgis/toolkit": "5.2.0-next.91",
24
+ "@arcgis/toolkit": "5.2.0-next.94",
25
25
  "@eslint/js": "^10.0.1",
26
26
  "@eslint/markdown": "^8.0.3",
27
27
  "@types/confusing-browser-globals": "^1.0.3",