@arcgis/eslint-config 5.2.0-next.0 → 5.2.0-next.10

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 (66) hide show
  1. package/dist/config/applications.d.ts +4 -10
  2. package/dist/config/applications.js +4 -4
  3. package/dist/config/extra.d.ts +4 -24
  4. package/dist/config/extra.js +2 -2
  5. package/dist/config/index.d.ts +4 -23
  6. package/dist/config/index.js +11 -12
  7. package/dist/config/lumina.d.ts +4 -3
  8. package/dist/config/lumina.js +8 -8
  9. package/dist/{estree-D4NC8KvY.js → estree-CDc-die8.js} +1 -39
  10. package/dist/makePlugin-CrKnVbDO.js +41 -0
  11. package/dist/plugins/core/index.d.ts +4 -0
  12. package/dist/plugins/core/index.js +702 -0
  13. package/dist/plugins/lumina/index.d.ts +4 -5
  14. package/dist/plugins/lumina/index.js +2 -1
  15. package/dist/plugins/utils/makePlugin.d.ts +15 -16
  16. package/dist/plugins/webgis/index.d.ts +4 -5
  17. package/dist/plugins/webgis/index.js +794 -119
  18. package/dist/utils/defineBoundaries.d.ts +28 -0
  19. package/dist/utils/defineBoundaries.js +50 -0
  20. package/dist/utils/{disable-rules.d.ts → disableRules.d.ts} +6 -6
  21. package/package.json +8 -3
  22. package/dist/config/storybook.d.ts +0 -2
  23. package/dist/plugins/lumina/plugin.d.ts +0 -8
  24. package/dist/plugins/lumina/rules/add-missing-jsx-import.d.ts +0 -2
  25. package/dist/plugins/lumina/rules/auto-add-type.d.ts +0 -3
  26. package/dist/plugins/lumina/rules/ban-events.d.ts +0 -6
  27. package/dist/plugins/lumina/rules/component-placement-rules.d.ts +0 -2
  28. package/dist/plugins/lumina/rules/consistent-event-naming.d.ts +0 -15
  29. package/dist/plugins/lumina/rules/consistent-nullability.d.ts +0 -2
  30. package/dist/plugins/lumina/rules/decorators-context.d.ts +0 -2
  31. package/dist/plugins/lumina/rules/explicit-setter-type.d.ts +0 -19
  32. package/dist/plugins/lumina/rules/member-ordering/build.d.ts +0 -4
  33. package/dist/plugins/lumina/rules/member-ordering/comments.d.ts +0 -19
  34. package/dist/plugins/lumina/rules/member-ordering/config.d.ts +0 -36
  35. package/dist/plugins/lumina/rules/member-ordering/normalize.d.ts +0 -10
  36. package/dist/plugins/lumina/rules/member-ordering.d.ts +0 -2
  37. package/dist/plugins/lumina/rules/no-create-element-component.d.ts +0 -2
  38. package/dist/plugins/lumina/rules/no-ignore-jsdoc-tag.d.ts +0 -2
  39. package/dist/plugins/lumina/rules/no-incorrect-dynamic-tag-name.d.ts +0 -3
  40. package/dist/plugins/lumina/rules/no-inline-arrow-in-ref.d.ts +0 -2
  41. package/dist/plugins/lumina/rules/no-inline-exposure-jsdoc-tag.d.ts +0 -2
  42. package/dist/plugins/lumina/rules/no-invalid-directives-prop.d.ts +0 -2
  43. package/dist/plugins/lumina/rules/no-jsdoc-xref-links.d.ts +0 -2
  44. package/dist/plugins/lumina/rules/no-jsx-spread.d.ts +0 -2
  45. package/dist/plugins/lumina/rules/no-listen-in-connected-callback.d.ts +0 -2
  46. package/dist/plugins/lumina/rules/no-non-component-exports.d.ts +0 -2
  47. package/dist/plugins/lumina/rules/no-property-name-start-with-on.d.ts +0 -2
  48. package/dist/plugins/lumina/rules/no-render-false.d.ts +0 -3
  49. package/dist/plugins/lumina/rules/no-unnecessary-assertion-on-event.d.ts +0 -3
  50. package/dist/plugins/lumina/rules/no-unnecessary-attribute-name.d.ts +0 -2
  51. package/dist/plugins/lumina/rules/no-unnecessary-bind-this.d.ts +0 -2
  52. package/dist/plugins/lumina/rules/no-unnecessary-key.d.ts +0 -2
  53. package/dist/plugins/lumina/rules/tag-name-rules.d.ts +0 -8
  54. package/dist/plugins/lumina/utils/checker.d.ts +0 -4
  55. package/dist/plugins/lumina/utils/estree.d.ts +0 -33
  56. package/dist/plugins/lumina/utils/tags.d.ts +0 -14
  57. package/dist/plugins/utils/helpers.d.ts +0 -2
  58. package/dist/plugins/webgis/plugin.d.ts +0 -8
  59. package/dist/plugins/webgis/rules/consistent-logging.d.ts +0 -2
  60. package/dist/plugins/webgis/rules/no-dts-files.d.ts +0 -2
  61. package/dist/plugins/webgis/rules/no-import-outside-src.d.ts +0 -2
  62. package/dist/plugins/webgis/rules/no-story-render-args-type-annotation.d.ts +0 -2
  63. package/dist/plugins/webgis/rules/no-touching-jsdoc.d.ts +0 -2
  64. package/dist/plugins/webgis/rules/no-unsafe-hash-links.d.ts +0 -2
  65. package/dist/plugins/webgis/rules/require-js-in-imports.d.ts +0 -2
  66. /package/dist/utils/{disable-rules.js → disableRules.js} +0 -0
@@ -1,10 +1,4 @@
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 | {
6
- files: string[];
7
- name?: string;
8
- rules?: object;
9
- })[];
10
- export default _default;
1
+ import type { TSESLint } from "@typescript-eslint/utils";
2
+
3
+ declare const config: TSESLint.FlatConfig.ConfigArray;
4
+ export default config;
@@ -1,6 +1,6 @@
1
- import defaultConfig from "./index.js";
2
- const applications = [
3
- ...defaultConfig,
1
+ import config$1 from "./index.js";
2
+ const config = [
3
+ ...config$1,
4
4
  {
5
5
  rules: {
6
6
  // Not autofixable. Can be annoying
@@ -36,5 +36,5 @@ const applications = [
36
36
  }
37
37
  ];
38
38
  export {
39
- applications as default
39
+ config as default
40
40
  };
@@ -1,24 +1,4 @@
1
- /**
2
- * In addition to the main config (index.js), which contains the recommended
3
- * rules that should be enabled all the time, these are some additional rules
4
- * that can be run from time to time. These are not always on either because
5
- * they have too many false positives or are too slow.
6
- */
7
- declare const _default: {
8
- files: string[];
9
- rules: {
10
- "@typescript-eslint/no-unsafe-return": "warn";
11
- "@typescript-eslint/unbound-method": "warn";
12
- "class-methods-use-this": "off";
13
- "@typescript-eslint/class-methods-use-this": ["warn", {
14
- ignoreOverrideMethods: boolean;
15
- ignoreClassesThatImplementAnInterface: string;
16
- }];
17
- /**
18
- * False positive when constructor exists to improve typing/narrow down the
19
- * type
20
- */
21
- "@typescript-eslint/no-useless-constructor": "warn";
22
- };
23
- }[];
24
- export default _default;
1
+ import type { TSESLint } from "@typescript-eslint/utils";
2
+
3
+ declare const config: TSESLint.FlatConfig.ConfigArray;
4
+ export default config;
@@ -1,4 +1,4 @@
1
- const extra = [
1
+ const config = [
2
2
  {
3
3
  files: ["**/*.ts", "**/*.tsx"],
4
4
  rules: {
@@ -31,5 +31,5 @@ const extra = [
31
31
  }
32
32
  ];
33
33
  export {
34
- extra as default
34
+ config as default
35
35
  };
@@ -1,23 +1,4 @@
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 | {
19
- files: string[];
20
- name?: string;
21
- rules?: object;
22
- })[];
23
- export default _default;
1
+ import type { TSESLint } from "@typescript-eslint/utils";
2
+
3
+ declare const config: TSESLint.FlatConfig.ConfigArray;
4
+ export default config;
@@ -6,23 +6,25 @@ import { webgisPlugin } from "../plugins/webgis/index.js";
6
6
  import { globalIgnores } from "eslint/config";
7
7
  import markdown from "@eslint/markdown";
8
8
  import packageJson from "eslint-plugin-package-json";
9
+ import { importX } from "eslint-plugin-import-x";
9
10
  const packageJsonSortableCollections = packageJson.rules["sort-collections"].meta.defaultOptions[0].filter(
10
11
  (collection) => !["scripts", "exports"].includes(collection)
11
12
  ) ?? [];
12
- const defaultConfig = [
13
+ const config = [
13
14
  globalIgnores(["**/www", "**/dist", "**/assets", "**/coverage", "**/.docs"]),
14
15
  {
15
16
  files: ["**/*.js", "**/*.mjs", "**/*.cjs"],
16
17
  ...eslint.configs.recommended
17
18
  },
18
- ...[...tsEslint.configs.strictTypeChecked, ...tsEslint.configs.stylisticTypeChecked].map((config) => ({
19
- ...config,
19
+ ...[...tsEslint.configs.strictTypeChecked, ...tsEslint.configs.stylisticTypeChecked].map((config2) => ({
20
+ ...config2,
20
21
  files: ["**/*.ts", "**/*.tsx"]
21
22
  })),
22
23
  {
23
24
  ...webgisPlugin.configs.recommended,
24
25
  files: ["**/*.ts", "**/*.tsx"]
25
26
  },
27
+ importX.flatConfigs.typescript,
26
28
  {
27
29
  files: ["**/*.ts", "**/*.tsx"],
28
30
  linterOptions: {
@@ -353,17 +355,14 @@ const defaultConfig = [
353
355
  */
354
356
  "@typescript-eslint/no-this-alias": "off",
355
357
  "no-warning-comments": [
356
- // TODO: consider forbidding TODO in favor of BUG, HACK, REFACTOR, FEATURE,
357
- // LOW, TEST, PERF. Then can configure IDE to assign different colors to
358
- // each of those
359
358
  "error",
360
359
  {
361
- // By emitting error for these TODOs, you can use them for things you
362
- // want to do in the current commit (since they will be reported as
363
- // an error by pre-commit hook). Convenient for not-forgetting to do
364
- // something
360
+ // This will error for // ME: comments. This is convenient to write
361
+ // temporary TODOs that ESLint will remind you to resolve before the
362
+ // pull request is merged.
365
363
  terms: ["ME"],
366
- location: "anywhere"
364
+ location: "start",
365
+ decoration: ["/", "*", ">"]
367
366
  }
368
367
  ],
369
368
  // Autofixable, so warn to be less disruptive
@@ -653,5 +652,5 @@ const defaultConfig = [
653
652
  }
654
653
  ];
655
654
  export {
656
- defaultConfig as default
655
+ config as default
657
656
  };
@@ -1,3 +1,4 @@
1
- import { TSESLint } from '@typescript-eslint/utils';
2
- declare const _default: TSESLint.FlatConfig.Config[];
3
- export default _default;
1
+ import type { TSESLint } from "@typescript-eslint/utils";
2
+
3
+ declare const config: TSESLint.FlatConfig.ConfigArray;
4
+ export default config;
@@ -4,16 +4,16 @@ const storybookConfig = [
4
4
  {
5
5
  ignores: ["**/storybook-static*"]
6
6
  },
7
- ...eslintPluginStorybook.configs["flat/recommended"].map((config) => ({
8
- ...config,
7
+ ...eslintPluginStorybook.configs["flat/recommended"].map((config2) => ({
8
+ ...config2,
9
9
  files: ["**/*.stories.@(ts|tsx)"]
10
10
  })),
11
- ...eslintPluginStorybook.configs["flat/addon-interactions"].map((config) => ({
12
- ...config,
11
+ ...eslintPluginStorybook.configs["flat/addon-interactions"].map((config2) => ({
12
+ ...config2,
13
13
  files: ["**/*.stories.@(ts|tsx)"]
14
14
  })),
15
- ...eslintPluginStorybook.configs["flat/csf-strict"].map((config) => ({
16
- ...config,
15
+ ...eslintPluginStorybook.configs["flat/csf-strict"].map((config2) => ({
16
+ ...config2,
17
17
  files: ["**/*.stories.@(ts|tsx)"]
18
18
  })),
19
19
  {
@@ -42,7 +42,7 @@ const storybookConfig = [
42
42
  }
43
43
  }
44
44
  ];
45
- const lumina = [
45
+ const config = [
46
46
  ...storybookConfig,
47
47
  {
48
48
  ...luminaPlugin.configs.recommended,
@@ -218,5 +218,5 @@ declare global {
218
218
  },*/
219
219
  ];
220
220
  export {
221
- lumina as default
221
+ config as default
222
222
  };
@@ -1,41 +1,4 @@
1
- import { ESLintUtils, AST_NODE_TYPES } from "@typescript-eslint/utils";
2
- const version = "5.2.0-next.0";
3
- const packageJson = {
4
- version
5
- };
6
- function makeEslintPlugin(pluginName, urlCreator) {
7
- const rules = [];
8
- const creator = ESLintUtils.RuleCreator(urlCreator);
9
- return {
10
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
11
- createRule(rule) {
12
- const { meta, name, ...rest } = rule;
13
- const docs = { ...meta.docs, name };
14
- const ruleModule = creator({ ...rest, meta: { ...meta, docs }, name });
15
- rules.push(ruleModule);
16
- return ruleModule;
17
- },
18
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
19
- finalize() {
20
- const config = {
21
- rules: Object.fromEntries(
22
- rules.map((rule) => [`${pluginName}/${rule.meta.docs.name}`, rule.meta.docs.defaultLevel])
23
- )
24
- };
25
- const plugin = {
26
- meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version: packageJson.version },
27
- configs: {
28
- recommended: config
29
- },
30
- rules: Object.fromEntries(rules.map((rule) => [rule.meta.docs.name, rule]))
31
- };
32
- config.plugins = {
33
- [pluginName]: plugin
34
- };
35
- return plugin;
36
- }
37
- };
38
- }
1
+ import { AST_NODE_TYPES } from "@typescript-eslint/utils";
39
2
  const unwrapExpression = (expression) => expression.type === AST_NODE_TYPES.TSAsExpression || expression.type === AST_NODE_TYPES.TSNonNullExpression || expression.type === AST_NODE_TYPES.TSSatisfiesExpression ? unwrapExpression(expression.expression) : expression;
40
3
  const luminaEntrypointName = "@arcgis/lumina";
41
4
  const luminaTestEntrypointName = "@arcgis/lumina-compiler/testing";
@@ -154,7 +117,6 @@ export {
154
117
  checkForLuminaJsx as j,
155
118
  isBindThisCallee as k,
156
119
  luminaJsxExportName as l,
157
- makeEslintPlugin as m,
158
120
  parsePropertyDecorator as p,
159
121
  sourceCodeDeclaresComponent as s,
160
122
  unwrapExpression as u
@@ -0,0 +1,41 @@
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ const version = "5.2.0-next.10";
3
+ const packageJson = {
4
+ version
5
+ };
6
+ function makeEslintPlugin(pluginName, urlCreator) {
7
+ const rules = [];
8
+ const creator = ESLintUtils.RuleCreator(urlCreator);
9
+ return {
10
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
11
+ createRule(rule) {
12
+ const { meta, name, ...rest } = rule;
13
+ const docs = { ...meta.docs, name };
14
+ const ruleModule = creator({ ...rest, meta: { ...meta, docs }, name });
15
+ rules.push(ruleModule);
16
+ return ruleModule;
17
+ },
18
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
19
+ finalize() {
20
+ const config = {
21
+ rules: Object.fromEntries(
22
+ rules.map((rule) => [`${pluginName}/${rule.meta.docs.name}`, rule.meta.docs.defaultLevel])
23
+ )
24
+ };
25
+ const plugin = {
26
+ meta: { name: `@arcgis/eslint-plugin-${pluginName}`, version: packageJson.version },
27
+ configs: {
28
+ recommended: config
29
+ },
30
+ rules: Object.fromEntries(rules.map((rule) => [rule.meta.docs.name, rule]))
31
+ };
32
+ config.plugins = {
33
+ [pluginName]: plugin
34
+ };
35
+ return plugin;
36
+ }
37
+ };
38
+ }
39
+ export {
40
+ makeEslintPlugin as m
41
+ };
@@ -0,0 +1,4 @@
1
+ import type { EslintPlugin } from "../utils/makePlugin.js";
2
+
3
+ /** Rules specific to \@arcgis/core */
4
+ export const corePlugin: EslintPlugin;