@arcgis/eslint-config 5.0.0-next.9 → 5.0.0-next.91

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.
Files changed (44) hide show
  1. package/dist/config/applications.d.ts +6 -31
  2. package/dist/config/index.d.ts +19 -31
  3. package/dist/config/index.js +2 -2
  4. package/dist/config/lumina.js +1 -9
  5. package/dist/{makePlugin-Cr90mmiJ.js → makePlugin-CMbb76Iz.js} +5 -2
  6. package/dist/plugins/lumina/index.d.ts +2 -2
  7. package/dist/plugins/lumina/index.js +135 -133
  8. package/dist/plugins/lumina/plugin.d.ts +3 -3
  9. package/dist/plugins/lumina/rules/add-missing-jsx-import.d.ts +1 -1
  10. package/dist/plugins/lumina/rules/auto-add-type.d.ts +1 -1
  11. package/dist/plugins/lumina/rules/ban-events.d.ts +1 -1
  12. package/dist/plugins/lumina/rules/component-placement-rules.d.ts +1 -1
  13. package/dist/plugins/lumina/rules/consistent-event-naming.d.ts +1 -1
  14. package/dist/plugins/lumina/rules/consistent-nullability.d.ts +1 -1
  15. package/dist/plugins/lumina/rules/decorators-context.d.ts +1 -1
  16. package/dist/plugins/lumina/rules/explicit-setter-type.d.ts +1 -1
  17. package/dist/plugins/lumina/rules/member-ordering/build.d.ts +2 -2
  18. package/dist/plugins/lumina/rules/member-ordering/comments.d.ts +1 -1
  19. package/dist/plugins/lumina/rules/member-ordering/normalize.d.ts +2 -2
  20. package/dist/plugins/lumina/rules/member-ordering.d.ts +1 -1
  21. package/dist/plugins/lumina/rules/no-create-element-component.d.ts +1 -1
  22. package/dist/plugins/lumina/rules/no-ignore-jsdoc-tag.d.ts +1 -1
  23. package/dist/plugins/lumina/rules/no-incorrect-dynamic-tag-name.d.ts +1 -1
  24. package/dist/plugins/lumina/rules/no-inline-arrow-in-ref.d.ts +1 -1
  25. package/dist/plugins/lumina/rules/no-invalid-directives-prop.d.ts +1 -1
  26. package/dist/plugins/lumina/rules/no-jsx-spread.d.ts +1 -1
  27. package/dist/plugins/lumina/rules/no-listen-in-connected-callback.d.ts +1 -1
  28. package/dist/plugins/lumina/rules/no-non-component-exports.d.ts +1 -1
  29. package/dist/plugins/lumina/rules/no-property-name-start-with-on.d.ts +1 -1
  30. package/dist/plugins/lumina/rules/no-render-false.d.ts +1 -1
  31. package/dist/plugins/lumina/rules/no-unnecessary-assertion-on-event.d.ts +1 -1
  32. package/dist/plugins/lumina/rules/no-unnecessary-attribute-name.d.ts +1 -1
  33. package/dist/plugins/lumina/rules/no-unnecessary-bind-this.d.ts +1 -1
  34. package/dist/plugins/lumina/rules/no-unnecessary-key.d.ts +1 -1
  35. package/dist/plugins/lumina/rules/tag-name-rules.d.ts +2 -2
  36. package/dist/plugins/webgis/index.d.ts +2 -2
  37. package/dist/plugins/webgis/index.js +48 -13
  38. package/dist/plugins/webgis/plugin.d.ts +3 -3
  39. package/dist/plugins/webgis/rules/consistent-logging.d.ts +2 -0
  40. package/dist/plugins/webgis/rules/no-dts-files.d.ts +1 -1
  41. package/dist/plugins/webgis/rules/no-import-outside-src.d.ts +1 -1
  42. package/dist/plugins/webgis/rules/no-touching-jsdoc.d.ts +1 -1
  43. package/dist/plugins/webgis/rules/require-js-in-imports.d.ts +1 -1
  44. package/package.json +8 -8
@@ -1,35 +1,10 @@
1
- import { TSESLint } from '@typescript-eslint/utils';
2
- declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
3
- name: string;
1
+ /**
2
+ * While the main index.js config strives to be comprehensive, this config
3
+ * disables rules that are less important for applications compared to libraries.
4
+ */
5
+ declare const _default: (import('eslint/config').Config | {
4
6
  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
7
  name?: string;
30
- plugins?: TSESLint.FlatConfig.Plugins;
31
- processor?: string | TSESLint.FlatConfig.Processor;
32
- rules?: TSESLint.FlatConfig.Rules;
33
- settings?: TSESLint.FlatConfig.Settings;
8
+ rules?: object;
34
9
  })[];
35
10
  export default _default;
@@ -1,35 +1,23 @@
1
- import { TSESLint } from '@typescript-eslint/utils';
2
- declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | {
3
- name: string;
1
+ /**
2
+ * See setup documentation & rationale behind ESLint:
3
+ * https://webgis.esri.com/references/support-packages/eslint
4
+ *
5
+ * Some advice on editing rules:
6
+ * - prioritize autofixable rules to make adoption in existing codebases easier
7
+ * - disable redundant rules (rules redundant with TypeScript, or each other),
8
+ * to reduce noise and performance impact
9
+ * - if rule is always auto-fixable, it may be a good idea to emit it as a
10
+ * warning instead of an error to be less disruptive when the developer is
11
+ * typing code
12
+ * - emit rules that have a lot of false positives as warnings instead of errors
13
+ * - provide justification for enabling opinionated rules
14
+ * - provide justification for disabling default rules
15
+ * - if rule is disabled because it's buggy, describe how so
16
+ * (code sample, GitHub issue, permalink to file, etc)
17
+ */
18
+ declare const _default: (import('eslint/config').Config | {
4
19
  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
20
  name?: string;
30
- plugins?: TSESLint.FlatConfig.Plugins;
31
- processor?: string | TSESLint.FlatConfig.Processor;
32
- rules?: TSESLint.FlatConfig.Rules;
33
- settings?: TSESLint.FlatConfig.Settings;
21
+ rules?: object;
34
22
  })[];
35
23
  export default _default;
@@ -310,7 +310,7 @@ const defaultConfig = [
310
310
  */
311
311
  "arrow-body-style": "warn",
312
312
  // This rule is a good idea, but not autofixable, so is only a warning
313
- // TODO: this does not support type-only imports. use import/no-duplicates instead
313
+ // TODO: this has basic type imports support. also consider import/no-duplicates
314
314
  "no-duplicate-imports": "off",
315
315
  // We will enforce strict curly. Rational:
316
316
  // - Same as core api
@@ -406,7 +406,7 @@ const defaultConfig = [
406
406
  }
407
407
  ],
408
408
  "@typescript-eslint/consistent-type-exports": ["warn", { fixMixedExportsWithInlineTypeSpecifier: true }],
409
- "@typescript-eslint/consistent-type-imports": "warn",
409
+ "@typescript-eslint/no-import-type-side-effects": "error",
410
410
  "default-param-last": "off",
411
411
  // `undefined` can also be used to trigger default value
412
412
  "@typescript-eslint/default-param-last": "off",
@@ -126,16 +126,8 @@ 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/context rather than directly calling the Lit's controllers/decorators. See https://qawebgis.esri.com/components/lumina/state-management#lit-context`,
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://webgis.esri.com/references/lumina/state-management#lit-context`,
130
130
  caseSensitive: true
131
- },
132
- {
133
- group: ["/@arcgis/components-controllers/accessor"],
134
- message: 'Import from "@arcgis/lumina/controllers/accessor" instead'
135
- },
136
- {
137
- group: ["/@arcgis/components-controllers"],
138
- message: 'Import from "@arcgis/lumina/controllers" instead'
139
131
  }
140
132
  ]
141
133
  }
@@ -1,5 +1,8 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
- const version = "5.0.0-next.9";
2
+ const version = "5.0.0-next.91";
3
+ const packageJson = {
4
+ version
5
+ };
3
6
  function makeEslintPlugin(pluginName, urlCreator) {
4
7
  const rules = [];
5
8
  const creator = ESLintUtils.RuleCreator(urlCreator);
@@ -20,7 +23,7 @@ function makeEslintPlugin(pluginName, urlCreator) {
20
23
  )
21
24
  };
22
25
  const plugin = {
23
- meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version },
26
+ meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version: packageJson.version },
24
27
  configs: {
25
28
  recommended: config
26
29
  },
@@ -1,5 +1,5 @@
1
- export declare const luminaPlugin: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
1
+ export declare const luminaPlugin: import("typescript-eslint").FlatConfig.Plugin & {
2
2
  configs: {
3
- recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
3
+ recommended: import("typescript-eslint").FlatConfig.Config;
4
4
  };
5
5
  };
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-Cr90mmiJ.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-CMbb76Iz.js";
2
2
  import { AST_NODE_TYPES, ESLintUtils, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
3
3
  import ts from "typescript";
4
4
  import { camelToKebab } from "@arcgis/toolkit/string";
@@ -209,7 +209,7 @@ More information: https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/
209
209
  },
210
210
  fix(fixer) {
211
211
  const nextToken = context.sourceCode.getTokenAfter(typeProperty.parent);
212
- const isTrailingComma = nextToken && nextToken.value === ",";
212
+ const isTrailingComma = nextToken?.value === ",";
213
213
  return isTrailingComma ? fixer.removeRange([typeProperty.parent.range[0], nextToken.range[1]]) : fixer.remove(typeProperty.parent);
214
214
  }
215
215
  });
@@ -463,7 +463,7 @@ plugin.createRule({
463
463
  messages: {
464
464
  eventNamespaceError: `Custom event name must start with one of the following prefixes: {{ prefixes }}.
465
465
 
466
- Details: https://qawebgis.esri.com/components/lumina/events#best-practices-around-emitting-events`,
466
+ Details: https://webgis.esri.com/references/lumina/events#best-practices-around-emitting-events`,
467
467
  componentNameInEventError: `For consistency, event name should not start with component name.
468
468
 
469
469
  Discussion: https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/307`,
@@ -595,7 +595,7 @@ plugin.createRule({
595
595
  messageId: "removeNeedlessDefault",
596
596
  fix(fixer) {
597
597
  const tokenBeforeDefaultValue = context.sourceCode.getTokenBefore(defaultValue);
598
- const isEqualsSign = tokenBeforeDefaultValue && tokenBeforeDefaultValue.value === "=";
598
+ const isEqualsSign = tokenBeforeDefaultValue?.value === "=";
599
599
  return isEqualsSign ? fixer.removeRange([tokenBeforeDefaultValue.range[0], defaultValue.range[1]]) : fixer.remove(defaultValue);
600
600
  }
601
601
  });
@@ -650,7 +650,7 @@ plugin.createRule({
650
650
  messages: {
651
651
  publicApiMustBePublic: `@property(), @method() and createEvent() members must not have private or protected modifier.
652
652
 
653
- If you wish to hide this member from public documentation, use @private or @protected JSDoc tags instead. Documentation: https://qawebgis.esri.com/components/lumina/documenting-components#excluding-api-from-public-documentation`,
653
+ If you wish to hide this member from public documentation, use @private or @protected JSDoc tags instead. Documentation: https://webgis.esri.com/references/lumina/documenting-components#excluding-api-from-public-documentation`,
654
654
  noPropertyDecoratorOnMethods: `Methods must not have @property() nor @state() decorator. Did you mean @property() instead?`,
655
655
  noCombinedPropertyEvent: `Property may either be an event (initialized with createEvent()) or a property (has @property() decorator), but not both`,
656
656
  noCombinedPropertyState: `Property may either be a state (initialized with @state()) or a property (has @property() decorator), but not both`,
@@ -1194,7 +1194,7 @@ plugin.createRule({
1194
1194
  * ignore possible errors in getter/setters (but those errors would
1195
1195
  * still be fixed as long as there is any other error in the file).
1196
1196
  */
1197
- !seenNames.has(name) && (member.type !== AST_NODE_TYPES.MethodDefinition || member.kind !== "get" && member.kind !== "set")
1197
+ !seenNames.has(name) && (member.type !== AST_NODE_TYPES.MethodDefinition || member.kind !== "get" && member.kind !== "set" && member.value.type !== AST_NODE_TYPES.TSEmptyBodyFunctionExpression)
1198
1198
  ) {
1199
1199
  wrongOrdering ||= currentRegion !== newRegion;
1200
1200
  wrongOrdering ||= previousRegion !== currentRegion && ordering.indexOf(previousRegion) > ordering.indexOf(currentRegion);
@@ -1263,7 +1263,7 @@ plugin.createRule({
1263
1263
  },
1264
1264
  fixable: "code",
1265
1265
  messages: {
1266
- default: "Use JSX instead of `document.createElement()` to create components.\nDetails: https://qawebgis.esri.com/components/lumina/jsx#rendering-jsx-outside-the-component"
1266
+ default: "Use JSX instead of `document.createElement()` to create components.\nDetails: https://webgis.esri.com/references/lumina/jsx#rendering-jsx-outside-the-component"
1267
1267
  },
1268
1268
  schema: [],
1269
1269
  type: "problem"
@@ -1299,7 +1299,7 @@ function isCreateElementComponent(node) {
1299
1299
  }
1300
1300
  return false;
1301
1301
  }
1302
- const description$d = `Use @internal or @private JSDoc tag over @ignore. See https://qawebgis.esri.com/components/lumina/documenting-components#excluding-api-from-public-documentation`;
1302
+ const description$d = `Use @internal or @private JSDoc tag over @ignore. See https://webgis.esri.com/references/lumina/documenting-components#excluding-api-from-public-documentation`;
1303
1303
  plugin.createRule({
1304
1304
  name: "no-ignore-jsdoc-tag",
1305
1305
  meta: {
@@ -1346,7 +1346,7 @@ plugin.createRule({
1346
1346
  defaultLevel: "error"
1347
1347
  },
1348
1348
  messages: {
1349
- incorrectDynamicTagName: `This is using incorrect dynamic tag name syntax. See documentation on how to use dynamic tag in Lumina's JSX: https://qawebgis.esri.com/components/lumina/jsx#dynamic-tag-name`
1349
+ incorrectDynamicTagName: `This is using incorrect dynamic tag name syntax. See documentation on how to use dynamic tag in Lumina's JSX: https://webgis.esri.com/references/lumina/jsx#dynamic-tag-name`
1350
1350
  },
1351
1351
  type: "problem",
1352
1352
  schema: []
@@ -1387,7 +1387,7 @@ plugin.createRule({
1387
1387
  });
1388
1388
  const description$b = `If inline arrow function is passed to ref, it will be called again on each render.
1389
1389
 
1390
- If this is not desirable, see alternatives: https://qawebgis.esri.com/components/lumina/jsx#refs`;
1390
+ If this is not desirable, see alternatives: https://webgis.esri.com/references/lumina/jsx#refs`;
1391
1391
  plugin.createRule({
1392
1392
  name: "no-inline-arrow-in-ref",
1393
1393
  meta: {
@@ -1422,7 +1422,7 @@ plugin.createRule({
1422
1422
  };
1423
1423
  }
1424
1424
  });
1425
- const description$a = `directives={} prop value must be an array literal. Documentation: https://qawebgis.esri.com/components/lumina/jsx#lit-directives`;
1425
+ const description$a = `directives={} prop value must be an array literal. Documentation: https://webgis.esri.com/references/lumina/jsx#lit-directives`;
1426
1426
  plugin.createRule({
1427
1427
  name: "no-invalid-directives-prop",
1428
1428
  meta: {
@@ -1468,7 +1468,7 @@ plugin.createRule({
1468
1468
  };
1469
1469
  }
1470
1470
  });
1471
- const description$9 = `This spread syntax is not supported. Alternatives: https://qawebgis.esri.com/components/lumina/jsx#spread-attributes`;
1471
+ const description$9 = `This spread syntax is not supported. Alternatives: https://webgis.esri.com/references/lumina/jsx#spread-attributes`;
1472
1472
  plugin.createRule({
1473
1473
  name: "no-jsx-spread",
1474
1474
  meta: {
@@ -1761,7 +1761,7 @@ plugin.createRule({
1761
1761
  messages: {
1762
1762
  needlessInlineJsxEventTypeAnnotation: "There is no need for this type annotation as JSX types already define event types.",
1763
1763
  redundantTypeAssertion: "This type assertion is likely unnecessary.",
1764
- avoidTypeAssertion: "This type assertion might be avoidable if you improve the event argument type. See examples in https://qawebgis.esri.com/components/lumina/events#listening-to-events-on-children-components"
1764
+ avoidTypeAssertion: "This type assertion might be avoidable if you improve the event argument type. See examples in https://webgis.esri.com/references/lumina/events#listening-to-events-on-children-components"
1765
1765
  },
1766
1766
  hasSuggestions: true,
1767
1767
  fixable: "code",
@@ -1884,7 +1884,7 @@ plugin.createRule({
1884
1884
  messageId: "noUnnecessaryAttributeName",
1885
1885
  fix(fixer) {
1886
1886
  const nextToken = context.sourceCode.getTokenAfter(attributeOption.parent);
1887
- const isTrailingComma = nextToken && nextToken.value === ",";
1887
+ const isTrailingComma = nextToken?.value === ",";
1888
1888
  return isTrailingComma ? fixer.removeRange([attributeOption.parent.range[0], nextToken.range[1]]) : fixer.remove(attributeOption.parent);
1889
1889
  }
1890
1890
  });
@@ -1956,7 +1956,7 @@ plugin.createRule({
1956
1956
  };
1957
1957
  }
1958
1958
  });
1959
- const description$1 = `In most cases, key={index} is not necessary in Lumina in .map(). Details: https://qawebgis.esri.com/components/lumina/jsx#key-prop`;
1959
+ const description$1 = `In most cases, key={index} is not necessary in Lumina in .map(). Details: https://webgis.esri.com/references/lumina/jsx#key-prop`;
1960
1960
  plugin.createRule({
1961
1961
  name: "no-unnecessary-key",
1962
1962
  meta: {
@@ -2037,17 +2037,12 @@ plugin.createRule({
2037
2037
  noTagNameIdentifier: "Tag name must include a dash",
2038
2038
  unexpectedDeclareElementsEntry: "Unexpected entry in declare elements interface. Expected a property signature",
2039
2039
  unexpectedDeclarationType: "Unexpected declaration type. Expected component class identifier",
2040
- duplicateDeclaration: "The same component may only be assigned to one class name. If you need multiple tag names, consider sub-classing the component",
2040
+ duplicateDeclaration: "The same component may only be assigned to one class name. If you need multiple tag names, consider sub-classing the component",
2041
2041
  missingClassDeclaration: "Missing class declaration",
2042
2042
  unexpectedTypeArguments: "Unexpected type arguments in the component tag name declaration. Type arguments should be specified in the component class declaration",
2043
2043
  reservedTagName: "This is a reserved html element tag name. Declaring components with this name is forbidden by the custom elements specification.",
2044
- duplicateDeclareGlobal: `There should only be a single "declare global" block in a file. Declaring multiple components in a single file is supported, but they should share the same "declare global {" block. Example:
2045
- declare global {
2046
- interface DeclareElements {
2047
- "arcgis-test1": ArcgisTest1;
2048
- "arcgis-test2": ArcgisTest2;
2049
- }
2050
- }`,
2044
+ duplicateDeclareGlobal: `There should only be a single "declare global" block in a file.`,
2045
+ multipleDeclarations: `There should only be a single "DeclareElements" interface in a "declare global" block with a single component declaration inside. Create a separate file to define additional components.`,
2051
2046
  mustSubclass: "Lumina component is required to subclass LitElement or a subclass of LitElement",
2052
2047
  mustNotSubclassHtmlElement: "Lumina component is not allowed to subclass HTMLElement classes directly. Subclass LitElement or a subclass of LitElement instead",
2053
2048
  tagNameClassNameMismatch: 'The custom element tag name "{{tagName}}" does not seem to match the class name it is assigned to: "{{className}}". Make sure tag name and class name use the same characters in the same order (case insensitive, hyphens removed). {{namespaceNotice}}',
@@ -2090,123 +2085,130 @@ declare global {
2090
2085
  return;
2091
2086
  }
2092
2087
  seenDeclareGlobal = true;
2093
- luminaDeclarationInterface.body.body.forEach((member) => {
2094
- if (member.type !== AST_NODE_TYPES.TSPropertySignature) {
2095
- context.report({
2096
- messageId: "unexpectedDeclareElementsEntry",
2097
- node: member
2098
- });
2099
- return;
2100
- }
2101
- if (member.computed) {
2102
- context.report({
2103
- messageId: "noComputedTagName",
2104
- node: member.key
2105
- });
2106
- return;
2107
- }
2108
- if (member.key.type === AST_NODE_TYPES.Identifier) {
2109
- context.report({
2110
- messageId: "noTagNameIdentifier",
2111
- node: member.key
2112
- });
2113
- return;
2114
- }
2115
- if (typeof member.key.value !== "string") {
2116
- context.report({
2117
- messageId: "noNonStringTagName",
2118
- node: member.key
2119
- });
2120
- return;
2121
- }
2122
- const tagName = member.key.value;
2123
- let namespaceFreeTagName = tagName;
2124
- const namespaces = options[0].namespaces;
2125
- if (namespaces.length > 0) {
2126
- const namespace = namespaces.find((ns) => tagName.startsWith(ns));
2127
- if (namespace === void 0) {
2128
- context.report({
2129
- messageId: "requireNamespace",
2130
- node: member.key,
2131
- data: {
2132
- namespaces: namespaces.join(", ")
2133
- }
2134
- });
2135
- return;
2136
- } else {
2137
- namespaceFreeTagName = tagName.slice(namespace.length);
2138
- }
2139
- }
2140
- if (!tagName.includes("-")) {
2141
- context.report({
2142
- messageId: "missingHyphen",
2143
- node: member.key
2144
- });
2145
- return;
2146
- }
2147
- if (tagName.toLowerCase() !== tagName) {
2148
- context.report({
2149
- messageId: "lowercaseTagName",
2150
- node: member.key
2151
- });
2152
- return;
2153
- }
2154
- if (!reCustomElementName.test(tagName)) {
2088
+ const members = luminaDeclarationInterface.body.body;
2089
+ if (members.length !== 1) {
2090
+ context.report({
2091
+ messageId: "multipleDeclarations",
2092
+ node: luminaDeclarationInterface
2093
+ });
2094
+ return;
2095
+ }
2096
+ const member = members[0];
2097
+ if (member.type !== AST_NODE_TYPES.TSPropertySignature) {
2098
+ context.report({
2099
+ messageId: "unexpectedDeclareElementsEntry",
2100
+ node: member
2101
+ });
2102
+ return;
2103
+ }
2104
+ if (member.computed) {
2105
+ context.report({
2106
+ messageId: "noComputedTagName",
2107
+ node: member.key
2108
+ });
2109
+ return;
2110
+ }
2111
+ if (member.key.type === AST_NODE_TYPES.Identifier) {
2112
+ context.report({
2113
+ messageId: "noTagNameIdentifier",
2114
+ node: member.key
2115
+ });
2116
+ return;
2117
+ }
2118
+ if (typeof member.key.value !== "string") {
2119
+ context.report({
2120
+ messageId: "noNonStringTagName",
2121
+ node: member.key
2122
+ });
2123
+ return;
2124
+ }
2125
+ const tagName = member.key.value;
2126
+ let namespaceFreeTagName = tagName;
2127
+ const namespaces = options[0].namespaces;
2128
+ if (namespaces.length > 0) {
2129
+ const namespace = namespaces.find((ns) => tagName.startsWith(ns));
2130
+ if (namespace === void 0) {
2155
2131
  context.report({
2156
- messageId: "invalidTagName",
2132
+ messageId: "requireNamespace",
2157
2133
  node: member.key,
2158
2134
  data: {
2159
- regex: reCustomElementName.toString()
2135
+ namespaces: namespaces.join(", ")
2160
2136
  }
2161
2137
  });
2162
2138
  return;
2139
+ } else {
2140
+ namespaceFreeTagName = tagName.slice(namespace.length);
2163
2141
  }
2164
- if (blockListedCustomElementNames.has(tagName)) {
2165
- context.report({
2166
- messageId: "reservedTagName",
2167
- node: member.key
2168
- });
2169
- return;
2170
- }
2171
- const type = member.typeAnnotation?.typeAnnotation;
2172
- if (type?.type !== AST_NODE_TYPES.TSTypeReference || type.typeName.type !== AST_NODE_TYPES.Identifier) {
2173
- context.report({
2174
- messageId: "unexpectedDeclarationType",
2175
- node: type ?? member
2176
- });
2177
- return;
2178
- }
2179
- if (type.typeArguments !== void 0) {
2180
- context.report({
2181
- messageId: "unexpectedTypeArguments",
2182
- node: type
2183
- });
2184
- return;
2185
- }
2186
- const className = type.typeName.name;
2187
- const classNameFromTagName = tagNameToNormalizedClassName(tagName);
2188
- const classNameFromShortTagName = tagNameToNormalizedClassName(namespaceFreeTagName);
2189
- if (classNameFromTagName !== className.toLowerCase() && classNameFromShortTagName !== className.toLowerCase()) {
2190
- context.report({
2191
- messageId: "tagNameClassNameMismatch",
2192
- node: type.typeName,
2193
- data: {
2194
- tagName,
2195
- className,
2196
- namespaceNotice: namespaces.length > 0 ? `In addition, the following tag name prefixes are expected: ${namespaces.join(", ")}` : ""
2197
- }
2198
- });
2199
- return;
2200
- }
2201
- if (declaredComponents.has(className)) {
2202
- context.report({
2203
- messageId: "duplicateDeclaration",
2204
- node: type.typeName
2205
- });
2206
- return;
2207
- }
2208
- declaredComponents.set(className, type.typeName);
2209
- });
2142
+ }
2143
+ if (!tagName.includes("-")) {
2144
+ context.report({
2145
+ messageId: "missingHyphen",
2146
+ node: member.key
2147
+ });
2148
+ return;
2149
+ }
2150
+ if (tagName.toLowerCase() !== tagName) {
2151
+ context.report({
2152
+ messageId: "lowercaseTagName",
2153
+ node: member.key
2154
+ });
2155
+ return;
2156
+ }
2157
+ if (!reCustomElementName.test(tagName)) {
2158
+ context.report({
2159
+ messageId: "invalidTagName",
2160
+ node: member.key,
2161
+ data: {
2162
+ regex: reCustomElementName.toString()
2163
+ }
2164
+ });
2165
+ return;
2166
+ }
2167
+ if (blockListedCustomElementNames.has(tagName)) {
2168
+ context.report({
2169
+ messageId: "reservedTagName",
2170
+ node: member.key
2171
+ });
2172
+ return;
2173
+ }
2174
+ const type = member.typeAnnotation?.typeAnnotation;
2175
+ if (type?.type !== AST_NODE_TYPES.TSTypeReference || type.typeName.type !== AST_NODE_TYPES.Identifier) {
2176
+ context.report({
2177
+ messageId: "unexpectedDeclarationType",
2178
+ node: type ?? member
2179
+ });
2180
+ return;
2181
+ }
2182
+ if (type.typeArguments !== void 0) {
2183
+ context.report({
2184
+ messageId: "unexpectedTypeArguments",
2185
+ node: type
2186
+ });
2187
+ return;
2188
+ }
2189
+ const className = type.typeName.name;
2190
+ const classNameFromTagName = tagNameToNormalizedClassName(tagName);
2191
+ const classNameFromShortTagName = tagNameToNormalizedClassName(namespaceFreeTagName);
2192
+ if (classNameFromTagName !== className.toLowerCase() && classNameFromShortTagName !== className.toLowerCase()) {
2193
+ context.report({
2194
+ messageId: "tagNameClassNameMismatch",
2195
+ node: type.typeName,
2196
+ data: {
2197
+ tagName,
2198
+ className,
2199
+ namespaceNotice: namespaces.length > 0 ? `In addition, the following tag name prefixes are expected: ${namespaces.join(", ")}` : ""
2200
+ }
2201
+ });
2202
+ return;
2203
+ }
2204
+ if (declaredComponents.has(className)) {
2205
+ context.report({
2206
+ messageId: "duplicateDeclaration",
2207
+ node: type.typeName
2208
+ });
2209
+ return;
2210
+ }
2211
+ declaredComponents.set(className, type.typeName);
2210
2212
  },
2211
2213
  "ClassDeclaration"(node) {
2212
2214
  if (node.id !== null && declaredComponents.has(node.id.name)) {
@@ -1,8 +1,8 @@
1
1
  export declare const plugin: {
2
- createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<import('@typescript-eslint/utils/eslint-utils').RuleWithMetaAndName<Options, MessageIds, Omit<import('../utils/makePlugin').CommonDocs, "name">>>) => import('@typescript-eslint/utils/ts-eslint').RuleModule<MessageIds, Options, import('../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
3
- finalize: () => import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
2
+ createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<import('@typescript-eslint/utils/eslint-utils').RuleWithMetaAndName<Options, MessageIds, Omit<import('../utils/makePlugin.ts').CommonDocs, "name">>>) => import('@typescript-eslint/utils/ts-eslint').RuleModule<MessageIds, Options, import('../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
3
+ finalize: () => import("typescript-eslint").FlatConfig.Plugin & {
4
4
  configs: {
5
- recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
5
+ recommended: import("typescript-eslint").FlatConfig.Config;
6
6
  };
7
7
  };
8
8
  };
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"addMissingJsxImport", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"addMissingJsxImport", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- declare const _default: ESLintUtils.RuleModule<"addType" | "typeAnnotationMismatchesActualType" | "noEmptyPropertyObject" | "noUnnecessaryType" | "unhandledType", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
2
+ declare const _default: ESLintUtils.RuleModule<"addType" | "typeAnnotationMismatchesActualType" | "noEmptyPropertyObject" | "noUnnecessaryType" | "unhandledType", [], import('../../utils/makePlugin.ts').CommonDocs, ESLintUtils.RuleListener>;
3
3
  export default _default;
@@ -2,5 +2,5 @@ type Options = (string | {
2
2
  event: string;
3
3
  message?: string;
4
4
  })[];
5
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"default", Options, import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
5
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"default", Options, import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
6
6
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"fileFolderNameMismatch" | "extensionNotTsx" | "noComponentOutsideSrcComponents", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"fileFolderNameMismatch" | "extensionNotTsx" | "noComponentOutsideSrcComponents", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -11,5 +11,5 @@ type Options = [
11
11
  }
12
12
  ];
13
13
  type Messages = "componentNameInEventError" | "eventNamespaceError" | "missingPrivateJsDocTag" | "noComponentNameInEventError";
14
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<Messages, Options, import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
14
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<Messages, Options, import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
15
15
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"consistentNullabilityError" | "removeNeedlessDefault", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"consistentNullabilityError" | "removeNeedlessDefault", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"publicApiMustBePublic" | "noPropertyDecoratorOnMethods" | "noCombinedPropertyEvent" | "noCombinedPropertyState" | "noComputedName", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"publicApiMustBePublic" | "noPropertyDecoratorOnMethods" | "noCombinedPropertyEvent" | "noCombinedPropertyState" | "noComputedName", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -15,5 +15,5 @@ import { ESLintUtils } from '@typescript-eslint/utils';
15
15
  * type. Then we can use it as is in the .d.ts file. The getter type can be
16
16
  * retrieved easily via `typeof` operator.
17
17
  */
18
- declare const _default: ESLintUtils.RuleModule<"explicitSetterType" | "addExplicitSetterType", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
18
+ declare const _default: ESLintUtils.RuleModule<"explicitSetterType" | "addExplicitSetterType", [], import('../../utils/makePlugin.ts').CommonDocs, ESLintUtils.RuleListener>;
19
19
  export default _default;
@@ -1,4 +1,4 @@
1
- import { StrayComments } from './comments';
2
- import { NormalizedRegions } from './normalize';
1
+ import { StrayComments } from './comments.ts';
2
+ import { NormalizedRegions } from './normalize.ts';
3
3
  import { TSESLint } from '@typescript-eslint/utils';
4
4
  export declare function buildNewBody(normalizedRegions: NormalizedRegions, strayComments: Omit<StrayComments, "membersByName">, sourceCode: TSESLint.SourceCode): string;
@@ -1,5 +1,5 @@
1
1
  import { TSESLint, TSESTree } from '@typescript-eslint/utils';
2
- import { MemberData } from './config';
2
+ import { MemberData } from './config.ts';
3
3
  export type StrayComments = {
4
4
  header: TSESTree.Comment[];
5
5
  regionFooter: Map<string, {
@@ -1,5 +1,5 @@
1
- import { StrayComments } from './comments';
2
- import { MemberData, RegionName } from './config';
1
+ import { StrayComments } from './comments.ts';
2
+ import { MemberData, RegionName } from './config.ts';
3
3
  export type NormalizedRegions = readonly (readonly [RegionName, MemberData[]])[];
4
4
  export declare function getNormalizedRegions(membersByName: StrayComments["membersByName"]): NormalizedRegions;
5
5
  /**
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"memberOrdering" | "unsupportedElementType", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"memberOrdering" | "unsupportedElementType", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"default", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"default", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noIgnoreJsDocTag", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noIgnoreJsDocTag", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- declare const _default: ESLintUtils.RuleModule<"incorrectDynamicTagName", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
2
+ declare const _default: ESLintUtils.RuleModule<"incorrectDynamicTagName", [], import('../../utils/makePlugin.ts').CommonDocs, ESLintUtils.RuleListener>;
3
3
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"errorInlineArrow", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"errorInlineArrow", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noInvalidDirectivesProp", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noInvalidDirectivesProp", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noJsxSpread", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noJsxSpread", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"errorListenInConnectedCallback", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"errorListenInConnectedCallback", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noNonComponentExports" | "noDefaultExports" | "noExportAll", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noNonComponentExports" | "noDefaultExports" | "noExportAll", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noPropertyNameStartWithOn", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noPropertyNameStartWithOn", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- declare const _default: ESLintUtils.RuleModule<"errorFalseRendered", [], import('../../utils/makePlugin').CommonDocs, ESLintUtils.RuleListener>;
2
+ declare const _default: ESLintUtils.RuleModule<"errorFalseRendered", [], import('../../utils/makePlugin.ts').CommonDocs, ESLintUtils.RuleListener>;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
1
  import { TSESLint } from '@typescript-eslint/utils';
2
- declare const _default: TSESLint.RuleModule<"needlessInlineJsxEventTypeAnnotation" | "redundantTypeAssertion" | "avoidTypeAssertion", [], import('../../utils/makePlugin').CommonDocs, TSESLint.RuleListener>;
2
+ declare const _default: TSESLint.RuleModule<"needlessInlineJsxEventTypeAnnotation" | "redundantTypeAssertion" | "avoidTypeAssertion", [], import('../../utils/makePlugin.ts').CommonDocs, TSESLint.RuleListener>;
3
3
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryAttributeName", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryAttributeName", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryBindThis", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryBindThis", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryKey", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noUnnecessaryKey", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -3,6 +3,6 @@ type Options = [
3
3
  namespaces?: readonly string[];
4
4
  }
5
5
  ];
6
- type Messages = "duplicateDeclaration" | "duplicateDeclareGlobal" | "invalidTagName" | "lowercaseTagName" | "missingClassDeclaration" | "missingHyphen" | "mustNotSubclassHtmlElement" | "mustSubclass" | "noComputedTagName" | "noNonStringTagName" | "noTagNameIdentifier" | "requireNamespace" | "reservedTagName" | "tagNameClassNameMismatch" | "unexpectedDeclarationType" | "unexpectedDeclareElementsEntry" | "unexpectedTypeArguments";
7
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<Messages, Options, import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
6
+ type Messages = "duplicateDeclaration" | "duplicateDeclareGlobal" | "invalidTagName" | "lowercaseTagName" | "missingClassDeclaration" | "missingHyphen" | "multipleDeclarations" | "mustNotSubclassHtmlElement" | "mustSubclass" | "noComputedTagName" | "noNonStringTagName" | "noTagNameIdentifier" | "requireNamespace" | "reservedTagName" | "tagNameClassNameMismatch" | "unexpectedDeclarationType" | "unexpectedDeclareElementsEntry" | "unexpectedTypeArguments";
7
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<Messages, Options, import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
8
8
  export default _default;
@@ -1,5 +1,5 @@
1
- export declare const webgisPlugin: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
1
+ export declare const webgisPlugin: import("typescript-eslint").FlatConfig.Plugin & {
2
2
  configs: {
3
- recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
3
+ recommended: import("typescript-eslint").FlatConfig.Config;
4
4
  };
5
5
  };
@@ -1,4 +1,4 @@
1
- import { m as makeEslintPlugin } from "../../makePlugin-Cr90mmiJ.js";
1
+ import { m as makeEslintPlugin } from "../../makePlugin-CMbb76Iz.js";
2
2
  import { resolve } from "path/posix";
3
3
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
4
4
  const plugin = makeEslintPlugin(
@@ -6,16 +6,16 @@ const plugin = makeEslintPlugin(
6
6
  (rule) => `https://devtopia.esri.com/WebGIS/arcgis-web-components/tree/main/packages/support-packages/eslint-config/src/plugins/webgis/rules/${rule}.ts`
7
7
  );
8
8
  const isTestFile = (filePath) => filePath.includes("/test") || filePath.includes(".test") || filePath.includes(".spec") || filePath.includes("e2e") || filePath.includes("__") || filePath.includes("/.");
9
- const description$3 = `Imports of files outside the src/ folder are not-portable and likely to break for consumers of this package.`;
9
+ const description$4 = `Imports of files outside the src/ folder are not-portable and likely to break for consumers of this package.`;
10
10
  plugin.createRule({
11
11
  name: "no-import-outside-src",
12
12
  meta: {
13
13
  docs: {
14
- description: description$3,
14
+ description: description$4,
15
15
  defaultLevel: "error"
16
16
  },
17
17
  messages: {
18
- noImportOutsideSrc: description$3
18
+ noImportOutsideSrc: description$4
19
19
  },
20
20
  type: "problem",
21
21
  schema: []
@@ -49,16 +49,16 @@ plugin.createRule({
49
49
  };
50
50
  }
51
51
  });
52
- const description$2 = `Having two JSDoc comments next to each other is most likely a mistake - consider combining them into one, or separating them for clarity.`;
52
+ const description$3 = `Having two JSDoc comments next to each other is most likely a mistake - consider combining them into one, or separating them for clarity.`;
53
53
  plugin.createRule({
54
54
  name: "no-touching-jsdoc",
55
55
  meta: {
56
56
  docs: {
57
- description: description$2,
57
+ description: description$3,
58
58
  defaultLevel: "warn"
59
59
  },
60
60
  messages: {
61
- noTouchingJsDoc: description$2
61
+ noTouchingJsDoc: description$3
62
62
  },
63
63
  type: "problem",
64
64
  schema: []
@@ -94,17 +94,17 @@ plugin.createRule({
94
94
  }
95
95
  });
96
96
  const reTouchingJsDoc = /\*\/\s+\/\*\*/gu;
97
- const description$1 = `@arcgis/core imports need to end with .js for better compatibility with ESM CDN builds for @arcgis/core and other packages.`;
97
+ const description$2 = `@arcgis/core imports need to end with .js for better compatibility with ESM CDN builds for @arcgis/core and other packages.`;
98
98
  const packagesToEnforce = ["@arcgis/core/", "@amcharts/amcharts4/", "@amcharts/amcharts5/"];
99
99
  plugin.createRule({
100
100
  name: "require-js-in-imports",
101
101
  meta: {
102
102
  docs: {
103
- description: description$1,
103
+ description: description$2,
104
104
  defaultLevel: "warn"
105
105
  },
106
106
  messages: {
107
- requireJsInCoreImport: description$1
107
+ requireJsInCoreImport: description$2
108
108
  },
109
109
  type: "problem",
110
110
  fixable: "code",
@@ -138,17 +138,17 @@ plugin.createRule({
138
138
  };
139
139
  }
140
140
  });
141
- const description = "Using .d.ts files is discouraged. Prefer .ts files instead, as they are type-checked and not in global scope.";
141
+ const description$1 = "Using .d.ts files is discouraged. Prefer .ts files instead, as they are type-checked and not in global scope.";
142
142
  const allowedNames = /* @__PURE__ */ new Set(["vite-env.d.ts", "components.d.ts"]);
143
143
  plugin.createRule({
144
144
  name: "no-dts-files",
145
145
  meta: {
146
146
  docs: {
147
- description,
147
+ description: description$1,
148
148
  defaultLevel: "warn"
149
149
  },
150
150
  messages: {
151
- avoidDtsFiles: description
151
+ avoidDtsFiles: description$1
152
152
  },
153
153
  type: "suggestion",
154
154
  schema: []
@@ -178,6 +178,41 @@ plugin.createRule({
178
178
  };
179
179
  }
180
180
  });
181
+ const description = `Enforce consistent logging so that ArcGIS developers can easily debug errors or warnings logged by our web components, which may lack a meaningful context in compiled code. See [our documentation on @arcgis/toolkit/log](https://webgis.esri.com/references/toolkit/log).`;
182
+ plugin.createRule({
183
+ name: "consistent-logging",
184
+ meta: {
185
+ docs: {
186
+ description,
187
+ defaultLevel: "off"
188
+ // NOTE: this is turned on conditionally in root eslint config
189
+ },
190
+ messages: {
191
+ consistentLoggingWarning: `For consistency, use the log utility from @arcgis/toolkit/log instead of console.{{logMethodName}}.`
192
+ },
193
+ schema: [],
194
+ fixable: void 0,
195
+ type: "suggestion"
196
+ },
197
+ defaultOptions: [],
198
+ create(context) {
199
+ return {
200
+ // NOTE: CallExpression is not enough. Use MemberExpression to handle callbacks, e.g. .catch(console.error)
201
+ MemberExpression(node) {
202
+ if (node.type === AST_NODE_TYPES.MemberExpression && node.object.type === AST_NODE_TYPES.Identifier && node.object.name === "console" && node.property.type === AST_NODE_TYPES.Identifier) {
203
+ const logMethodName = node.property.name;
204
+ context.report({
205
+ node,
206
+ messageId: "consistentLoggingWarning",
207
+ data: {
208
+ logMethodName
209
+ }
210
+ });
211
+ }
212
+ }
213
+ };
214
+ }
215
+ });
181
216
  const webgisPlugin = plugin.finalize();
182
217
  export {
183
218
  webgisPlugin
@@ -1,8 +1,8 @@
1
1
  export declare const plugin: {
2
- createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<import('@typescript-eslint/utils/eslint-utils').RuleWithMetaAndName<Options, MessageIds, Omit<import('../utils/makePlugin').CommonDocs, "name">>>) => import('@typescript-eslint/utils/ts-eslint').RuleModule<MessageIds, Options, import('../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
3
- finalize: () => import("@typescript-eslint/utils/ts-eslint").FlatConfig.Plugin & {
2
+ createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<import('@typescript-eslint/utils/eslint-utils').RuleWithMetaAndName<Options, MessageIds, Omit<import('../utils/makePlugin.ts').CommonDocs, "name">>>) => import('@typescript-eslint/utils/ts-eslint').RuleModule<MessageIds, Options, import('../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
3
+ finalize: () => import("typescript-eslint").FlatConfig.Plugin & {
4
4
  configs: {
5
- recommended: import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config;
5
+ recommended: import("typescript-eslint").FlatConfig.Config;
6
6
  };
7
7
  };
8
8
  };
@@ -0,0 +1,2 @@
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"consistentLoggingWarning", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
+ export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"avoidDtsFiles", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"avoidDtsFiles", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noImportOutsideSrc", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noImportOutsideSrc", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noTouchingJsDoc", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"noTouchingJsDoc", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"requireJsInCoreImport", [], import('../../utils/makePlugin').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
1
+ declare const _default: import('@typescript-eslint/utils/ts-eslint').RuleModule<"requireJsInCoreImport", [], import('../../utils/makePlugin.ts').CommonDocs, import('@typescript-eslint/utils/ts-eslint').RuleListener>;
2
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/eslint-config",
3
- "version": "5.0.0-next.9",
3
+ "version": "5.0.0-next.91",
4
4
  "description": "ESLint configuration for arcgis-web-components",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -20,18 +20,18 @@
20
20
  ],
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "dependencies": {
23
- "@arcgis/toolkit": "5.0.0-next.9",
24
- "@eslint/js": "^9.29.0",
25
- "@eslint/markdown": "^6.6.0",
23
+ "@arcgis/toolkit": "5.0.0-next.91",
24
+ "@eslint/js": "^9.39.1",
25
+ "@eslint/markdown": "^7.5.1",
26
26
  "@types/confusing-browser-globals": "^1.0.3",
27
27
  "confusing-browser-globals": "^1.0.11",
28
28
  "eslint-plugin-storybook": "^0.12.0",
29
- "globals": "^16.3.0",
29
+ "globals": "^16.5.0",
30
30
  "tslib": "^2.8.1",
31
- "typescript": "~5.8.3",
32
- "typescript-eslint": "^8.35.0"
31
+ "typescript": "~5.9.3",
32
+ "typescript-eslint": "^8.46.3"
33
33
  },
34
34
  "peerDependencies": {
35
- "eslint": "^9.29.0"
35
+ "eslint": "^9.39.1"
36
36
  }
37
37
  }