@arcgis/eslint-config 4.34.0-next.16 → 4.34.0-next.160

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.
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Licensing
2
2
 
3
- COPYRIGHT © 2025 Esri
3
+ COPYRIGHT © Esri
4
4
 
5
5
  All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
6
6
 
package/README.md CHANGED
@@ -8,14 +8,6 @@ It is not intended to be used directly, but rather used as a dependency by other
8
8
 
9
9
  ## License
10
10
 
11
- COPYRIGHT © 2025 Esri
11
+ COPYRIGHT © Esri
12
12
 
13
- All rights reserved under the copyright laws of the United States and applicable international laws, treaties, and conventions.
14
-
15
- This material is licensed for use under the Esri Master License Agreement (MLA), and is bound by the terms of that agreement. You may redistribute and use this code without modification, provided you adhere to the terms of the MLA and include this copyright notice.
16
-
17
- See use restrictions at <http://www.esri.com/legal/pdfs/mla_e204_e300/english>
18
-
19
- For additional information, contact: Environmental Systems Research Institute, Inc. Attn: Contracts and Legal Services Department 380 New York Street Redlands, California, USA 92373 USA
20
-
21
- email: contracts@esri.com
13
+ This package is licensed under the terms described in the `LICENSE.md` file, located in the root of the package.
@@ -1,5 +1,35 @@
1
1
  import { TSESLint } from '@typescript-eslint/utils';
2
- declare const _default: (TSESLint.FlatConfig.Config | import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
3
- readonly rules: Readonly<import("eslint").Linter.RulesRecord>;
2
+ declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
3
+ name: string;
4
+ files: string[];
5
+ language: string;
6
+ plugins: {};
7
+ rules: {
8
+ readonly "markdown/fenced-code-language": "error";
9
+ readonly "markdown/heading-increment": "error";
10
+ readonly "markdown/no-duplicate-definitions": "error";
11
+ readonly "markdown/no-empty-definitions": "error";
12
+ readonly "markdown/no-empty-images": "error";
13
+ readonly "markdown/no-empty-links": "error";
14
+ readonly "markdown/no-invalid-label-refs": "error";
15
+ readonly "markdown/no-missing-atx-heading-space": "error";
16
+ readonly "markdown/no-missing-label-refs": "error";
17
+ readonly "markdown/no-missing-link-fragments": "error";
18
+ readonly "markdown/no-multiple-h1": "error";
19
+ readonly "markdown/no-reversed-media-syntax": "error";
20
+ readonly "markdown/require-alt-text": "error";
21
+ readonly "markdown/table-column-count": "error";
22
+ };
23
+ } | {
24
+ files: (string | string[])[];
25
+ ignores?: string[];
26
+ language?: string;
27
+ languageOptions?: TSESLint.FlatConfig.LanguageOptions;
28
+ linterOptions?: TSESLint.FlatConfig.LinterOptions;
29
+ name?: string;
30
+ plugins?: TSESLint.FlatConfig.Plugins;
31
+ processor?: string | TSESLint.FlatConfig.Processor;
32
+ rules?: TSESLint.FlatConfig.Rules;
33
+ settings?: TSESLint.FlatConfig.Settings;
4
34
  })[];
5
35
  export default _default;
@@ -1,5 +1,35 @@
1
1
  import { TSESLint } from '@typescript-eslint/utils';
2
- declare const _default: (TSESLint.FlatConfig.Config | import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
3
- readonly rules: Readonly<import("eslint").Linter.RulesRecord>;
2
+ declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
3
+ name: string;
4
+ files: string[];
5
+ language: string;
6
+ plugins: {};
7
+ rules: {
8
+ readonly "markdown/fenced-code-language": "error";
9
+ readonly "markdown/heading-increment": "error";
10
+ readonly "markdown/no-duplicate-definitions": "error";
11
+ readonly "markdown/no-empty-definitions": "error";
12
+ readonly "markdown/no-empty-images": "error";
13
+ readonly "markdown/no-empty-links": "error";
14
+ readonly "markdown/no-invalid-label-refs": "error";
15
+ readonly "markdown/no-missing-atx-heading-space": "error";
16
+ readonly "markdown/no-missing-label-refs": "error";
17
+ readonly "markdown/no-missing-link-fragments": "error";
18
+ readonly "markdown/no-multiple-h1": "error";
19
+ readonly "markdown/no-reversed-media-syntax": "error";
20
+ readonly "markdown/require-alt-text": "error";
21
+ readonly "markdown/table-column-count": "error";
22
+ };
23
+ } | {
24
+ files: (string | string[])[];
25
+ ignores?: string[];
26
+ language?: string;
27
+ languageOptions?: TSESLint.FlatConfig.LanguageOptions;
28
+ linterOptions?: TSESLint.FlatConfig.LinterOptions;
29
+ name?: string;
30
+ plugins?: TSESLint.FlatConfig.Plugins;
31
+ processor?: string | TSESLint.FlatConfig.Processor;
32
+ rules?: TSESLint.FlatConfig.Rules;
33
+ settings?: TSESLint.FlatConfig.Settings;
4
34
  })[];
5
35
  export default _default;
@@ -4,11 +4,17 @@ import restrictedGlobals from "confusing-browser-globals";
4
4
  import globals from "globals";
5
5
  import { webgisPlugin } from "../plugins/webgis/index.js";
6
6
  import { globalIgnores } from "eslint/config";
7
+ import markdown from "@eslint/markdown";
7
8
  const defaultConfig = [
8
9
  globalIgnores(["**/www", "**/dist", "**/assets", "**/coverage", "**/.docs"]),
9
- eslint.configs.recommended,
10
- ...tsEslint.configs.strictTypeChecked,
11
- ...tsEslint.configs.stylisticTypeChecked,
10
+ {
11
+ files: ["**/*.js", "**/*.mjs", "**/*.cjs"],
12
+ ...eslint.configs.recommended
13
+ },
14
+ ...[...tsEslint.configs.strictTypeChecked, ...tsEslint.configs.stylisticTypeChecked].map((config) => ({
15
+ ...config,
16
+ files: ["**/*.ts", "**/*.tsx"]
17
+ })),
12
18
  {
13
19
  ...webgisPlugin.configs.recommended,
14
20
  files: ["**/*.ts", "**/*.tsx"]
@@ -22,8 +28,7 @@ const defaultConfig = [
22
28
  languageOptions: {
23
29
  globals: {
24
30
  ...globals.browser,
25
- ...globals.node,
26
- ...globals.jest
31
+ ...globals.node
27
32
  },
28
33
  ecmaVersion: "latest",
29
34
  sourceType: "module"
@@ -539,11 +544,28 @@ const defaultConfig = [
539
544
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
540
545
  // Developer may actually mean to use ||
541
546
  // Also, refactoring this out may break things
542
- "@typescript-eslint/prefer-nullish-coalescing": "off"
547
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
548
+ "@typescript-eslint/no-unnecessary-type-conversion": "warn"
543
549
  //#endregion
544
550
  // TODO: go over https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting
545
551
  }
546
552
  },
553
+ ...markdown.configs.recommended,
554
+ {
555
+ files: ["**/*.md"],
556
+ language: "markdown/gfm",
557
+ languageOptions: {
558
+ frontmatter: "yaml"
559
+ },
560
+ rules: {
561
+ // we don't really use label refs and currently this rule does errors on GFM alerts.
562
+ // https://github.com/eslint/markdown/issues/294
563
+ "markdown/no-missing-label-refs": ["off"],
564
+ // We allow frontmatter titles to be different from the h1 by setting to "" which never matches
565
+ // This is useful to have a shorter title in the TOC than on the page.
566
+ "markdown/no-multiple-h1": ["error", { frontmatterTitle: "" }]
567
+ }
568
+ },
547
569
  {
548
570
  // Don't do type-aware linting for untyped files
549
571
  files: ["**/*.js"],
@@ -126,7 +126,7 @@ declare global {
126
126
  {
127
127
  group: ["/@lit/context"],
128
128
  importNames: ["ContextProvider", "ContextConsumer", "provide", "consume"],
129
- message: `For lazy-loading compatibility, import the useContextProvider() and the useContextConsumer() controllers from @arcgis/lumina rather than directly calling the Lit's controllers/decorators.`,
129
+ message: `For lazy-loading compatibility, import the useContextProvider() and the useContextConsumer() controllers from @arcgis/lumina/context rather than directly calling the Lit's controllers/decorators. See https://qawebgis.esri.com/components/lumina/state-management#lit-context`,
130
130
  caseSensitive: true
131
131
  },
132
132
  {
@@ -1,5 +1,5 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
- const version = "4.34.0-next.16";
2
+ const version = "4.34.0-next.160";
3
3
  function makeEslintPlugin(pluginName, urlCreator) {
4
4
  const rules = [];
5
5
  const creator = ESLintUtils.RuleCreator(urlCreator);
@@ -1,7 +1,7 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-aauNgjXD.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-C-toyvI0.js";
2
2
  import { AST_NODE_TYPES, ESLintUtils, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
3
3
  import ts from "typescript";
4
- import { camelToKebab } from "@arcgis/components-utils";
4
+ import { camelToKebab } from "@arcgis/toolkit/string";
5
5
  const plugin = makeEslintPlugin(
6
6
  "lumina",
7
7
  (rule) => `https://devtopia.esri.com/WebGIS/arcgis-web-components/tree/main/packages/support-packages/eslint-config/src/plugins/lumina/rules/${rule}.ts`
@@ -1131,12 +1131,12 @@ ${newBodyContent}
1131
1131
  }`;
1132
1132
  return newBody;
1133
1133
  }
1134
- const baseDescription$3 = `Consistently sort component members`;
1134
+ const baseDescription$2 = `Consistently sort component members`;
1135
1135
  plugin.createRule({
1136
1136
  name: "member-ordering",
1137
1137
  meta: {
1138
1138
  docs: {
1139
- description: baseDescription$3,
1139
+ description: baseDescription$2,
1140
1140
  defaultLevel: "warn"
1141
1141
  },
1142
1142
  messages: {
@@ -1277,7 +1277,7 @@ plugin.createRule({
1277
1277
  return;
1278
1278
  }
1279
1279
  if (isCreateElementComponent(node)) {
1280
- return void context.report({
1280
+ return context.report({
1281
1281
  node,
1282
1282
  messageId: "default"
1283
1283
  });
@@ -1385,16 +1385,15 @@ plugin.createRule({
1385
1385
  };
1386
1386
  }
1387
1387
  });
1388
- const baseDescription$2 = `Do not pass an inline arrow function to a ref prop - such syntax creates a new function on each render, which makes Lit call ref callback again on each render.`;
1389
- const description$b = `${baseDescription$2}
1388
+ const description$b = `If inline arrow function is passed to ref, it will be called again on each render.
1390
1389
 
1391
- Alternatives: https://qawebgis.esri.com/components/lumina/jsx#refs`;
1390
+ If this is not desirable, see alternatives: https://qawebgis.esri.com/components/lumina/jsx#refs`;
1392
1391
  plugin.createRule({
1393
1392
  name: "no-inline-arrow-in-ref",
1394
1393
  meta: {
1395
1394
  docs: {
1396
- description: baseDescription$2,
1397
- defaultLevel: "error"
1395
+ description: description$b,
1396
+ defaultLevel: "warn"
1398
1397
  },
1399
1398
  messages: {
1400
1399
  errorInlineArrow: description$b
@@ -1,5 +1,5 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-aauNgjXD.js";
2
- import { resolve } from "node:path/posix";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-C-toyvI0.js";
2
+ import { resolve } from "path/posix";
3
3
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
4
4
  const plugin = makeEslintPlugin(
5
5
  "webgis",
@@ -120,8 +120,10 @@ plugin.createRule({
120
120
  return;
121
121
  }
122
122
  const specifier = node.source.value;
123
+ const lastSlashIndex = specifier?.toString().lastIndexOf("/") ?? 0;
124
+ const dotSearchIndex = lastSlashIndex === -1 ? 0 : lastSlashIndex + 1;
123
125
  if (typeof specifier !== "string" || !packagesToEnforce.some((pkg) => specifier.startsWith(pkg)) || // Already ends with .js or .json
124
- specifier.includes(".")) {
126
+ specifier.includes(".", dotSearchIndex)) {
125
127
  return;
126
128
  }
127
129
  context.report({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/eslint-config",
3
- "version": "4.34.0-next.16",
3
+ "version": "4.34.0-next.160",
4
4
  "description": "ESLint configuration for arcgis-web-components",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -20,17 +20,18 @@
20
20
  ],
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "dependencies": {
23
- "@arcgis/components-utils": "4.34.0-next.16",
24
- "@eslint/js": "^9.23.0",
23
+ "@arcgis/toolkit": "4.34.0-next.160",
24
+ "@eslint/js": "^9.29.0",
25
+ "@eslint/markdown": "^6.6.0",
25
26
  "@types/confusing-browser-globals": "^1.0.3",
26
27
  "confusing-browser-globals": "^1.0.11",
27
28
  "eslint-plugin-storybook": "^0.12.0",
28
- "globals": "^15.12.0",
29
+ "globals": "^16.3.0",
29
30
  "tslib": "^2.8.1",
30
31
  "typescript": "~5.8.3",
31
- "typescript-eslint": "^8.28.0"
32
+ "typescript-eslint": "^8.35.0"
32
33
  },
33
34
  "peerDependencies": {
34
- "eslint": "^9.23.0"
35
+ "eslint": "^9.29.0"
35
36
  }
36
37
  }