@o3r/eslint-plugin 11.0.0-next.0 → 11.0.0-next.1

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 (28) hide show
  1. package/README.md +6 -2
  2. package/package.json +37 -30
  3. package/schematics/ng-add/schema.json +18 -0
  4. package/src/rules/json/json-dependency-versions-harmonize/json-dependency-versions-harmonize.d.ts +7 -5
  5. package/src/rules/json/json-dependency-versions-harmonize/json-dependency-versions-harmonize.js +33 -10
  6. package/src/rules/json/json-dependency-versions-harmonize/version-harmonize.js +2 -1
  7. package/src/rules/json/utils.d.ts +3 -3
  8. package/src/rules/template/no-inner-html/no-inner-html.d.ts +1 -1
  9. package/src/rules/template/no-inner-html/no-inner-html.js +1 -1
  10. package/src/rules/template/template-async-number-limitation/template-async-number-limitation.d.ts +1 -1
  11. package/src/rules/template/template-async-number-limitation/template-async-number-limitation.js +1 -1
  12. package/src/rules/template/utils.d.ts +3 -3
  13. package/src/rules/typescript/matching-configuration-name/matching-configuration-name.d.ts +1 -4
  14. package/src/rules/typescript/matching-configuration-name/matching-configuration-name.js +9 -9
  15. package/src/rules/typescript/no-folder-import-for-module/no-folder-import-for-module.d.ts +1 -3
  16. package/src/rules/typescript/no-folder-import-for-module/no-folder-import-for-module.js +1 -1
  17. package/src/rules/typescript/no-multiple-type-configuration-property/no-multiple-type-configuration-property.d.ts +1 -1
  18. package/src/rules/typescript/no-multiple-type-configuration-property/no-multiple-type-configuration-property.js +8 -8
  19. package/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.d.ts +1 -1
  20. package/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.js +1 -1
  21. package/src/rules/typescript/o3r-widget-tags/o3r-widget-tags.d.ts +3 -3
  22. package/src/rules/typescript/o3r-widget-tags/o3r-widget-tags.js +2 -1
  23. package/src/rules/utils.d.ts +2 -2
  24. package/src/rules/utils.js +6 -6
  25. package/src/rules/yaml/utils.d.ts +3 -3
  26. package/src/rules/yaml/yarnrc-package-extensions-harmonize/yarnrc-package-extensions-harmonize.d.ts +1 -1
  27. package/src/rules/yaml/yarnrc-package-extensions-harmonize/yarnrc-package-extensions-harmonize.js +2 -1
  28. package/tsconfig.tsbuildinfo +1 -1
package/README.md CHANGED
@@ -9,6 +9,9 @@ This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/ot
9
9
 
10
10
  ## Description
11
11
 
12
+ [![Stable Version](https://img.shields.io/npm/v/@o3r/eslint-plugin?style=for-the-badge)](https://www.npmjs.com/package/@o3r/eslint-plugin)
13
+ [![Bundle Size](https://img.shields.io/bundlephobia/min/@o3r/eslint-plugin?color=green&style=for-the-badge)](https://www.npmjs.com/package/@o3r/eslint-plugin)
14
+
12
15
  The module provides in-house eslint plugins to use in your own eslint configuration.
13
16
 
14
17
  ## How to install
@@ -17,8 +20,9 @@ The module provides in-house eslint plugins to use in your own eslint configurat
17
20
  ng add @o3r/eslint-plugin
18
21
  ```
19
22
 
20
- > **Warning**: this module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
23
+ > [!WARNING]
24
+ > This module requires [@o3r/core](https://www.npmjs.com/package/@o3r/core) to be installed.
21
25
 
22
26
  ## Rules
23
27
 
24
- The list of rules is available in the [documentation](https://github.com/AmadeusITGroup/otter/tree/main/docs/linter/eslint-plugin/rules.md).
28
+ The list of rules is available in the [documentation](https://github.com/AmadeusITGroup/otter/tree/main/docs/linter/eslint-plugin/rules).
package/package.json CHANGED
@@ -1,6 +1,9 @@
1
1
  {
2
2
  "name": "@o3r/eslint-plugin",
3
- "version": "11.0.0-next.0",
3
+ "version": "11.0.0-next.1",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "The module provides in-house eslint plugins to use in your own eslint configuration.",
5
8
  "main": "./src/public_api.js",
6
9
  "keywords": [
@@ -17,14 +20,15 @@
17
20
  "build": "yarn nx build eslint-plugin",
18
21
  "postbuild": "patch-package-json-main",
19
22
  "prepare:publish": "prepare-publish ./dist",
20
- "prepare:build:builders": "yarn cpy './collection.json' dist",
23
+ "prepare:build:builders": "yarn cpy 'schematics/**/*.json' 'schematics/**/templates/**' dist/schematics && yarn cpy './collection.json' dist",
21
24
  "build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest"
22
25
  },
23
26
  "dependencies": {
24
- "@typescript-eslint/experimental-utils": "^5.3.0",
27
+ "@typescript-eslint/utils": "~7.8.0",
25
28
  "globby": "^11.1.0",
26
29
  "semver": "^7.5.2",
27
- "tslib": "^2.5.3"
30
+ "tslib": "^2.6.2",
31
+ "type-fest": "^4.10.2"
28
32
  },
29
33
  "peerDependenciesMeta": {
30
34
  "@angular-eslint/template-parser": {
@@ -38,47 +42,50 @@
38
42
  }
39
43
  },
40
44
  "peerDependencies": {
41
- "@angular-eslint/template-parser": "~17.1.0",
42
- "@angular-eslint/utils": "~17.1.0",
43
- "@angular/compiler": "~17.0.2",
44
- "@typescript-eslint/eslint-plugin": "^6.11.0",
45
- "@typescript-eslint/parser": "^6.11.0",
45
+ "@angular-eslint/template-parser": "~17.3.0",
46
+ "@angular-eslint/utils": "~17.3.0",
47
+ "@angular/compiler": "~17.3.0",
48
+ "@stylistic/eslint-plugin-ts": "^1.5.4",
49
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
50
+ "@typescript-eslint/parser": "^7.0.1",
46
51
  "eslint": "^8.22.0",
47
52
  "jsonc-eslint-parser": "~2.4.0",
48
53
  "yaml-eslint-parser": "^1.2.2"
49
54
  },
50
55
  "devDependencies": {
51
- "@angular-devkit/core": "~17.0.3",
52
- "@angular-devkit/schematics": "~17.0.3",
53
- "@angular-eslint/eslint-plugin": "~17.1.0",
54
- "@angular-eslint/template-parser": "~17.1.0",
55
- "@angular-eslint/utils": "~17.1.0",
56
- "@angular/compiler": "~17.0.4",
57
- "@babel/core": "~7.23.0",
58
- "@babel/preset-typescript": "~7.23.0",
56
+ "@angular-devkit/core": "~17.3.0",
57
+ "@angular-devkit/schematics": "~17.3.0",
58
+ "@angular-eslint/eslint-plugin": "~17.3.0",
59
+ "@angular-eslint/template-parser": "~17.3.0",
60
+ "@angular-eslint/utils": "~17.3.0",
61
+ "@angular/compiler": "~17.3.0",
62
+ "@babel/core": "~7.24.0",
63
+ "@babel/preset-typescript": "~7.24.0",
59
64
  "@compodoc/compodoc": "^1.1.19",
60
- "@nx/eslint-plugin": "~17.1.1",
61
- "@nx/jest": "~17.1.1",
62
- "@o3r/build-helpers": "^11.0.0-next.0",
65
+ "@nx/eslint-plugin": "~18.3.0",
66
+ "@nx/jest": "~18.3.0",
67
+ "@o3r/build-helpers": "^11.0.0-next.1",
68
+ "@o3r/test-helpers": "^11.0.0-next.1",
69
+ "@stylistic/eslint-plugin-ts": "^1.5.4",
63
70
  "@types/jest": "~29.5.2",
64
71
  "@types/node": "^20.0.0",
65
72
  "@types/semver": "^7.3.13",
66
- "@typescript-eslint/eslint-plugin": "6.11.0",
67
- "@typescript-eslint/parser": "^6.11.0",
73
+ "@typescript-eslint/eslint-plugin": "^7.2.0",
74
+ "@typescript-eslint/parser": "^7.2.0",
68
75
  "cpy-cli": "^5.0.0",
69
- "eslint": "^8.42.0",
70
- "eslint-plugin-jest": "~27.6.0",
71
- "eslint-plugin-jsdoc": "~48.0.0",
76
+ "eslint": "^8.57.0",
77
+ "eslint-plugin-jest": "~27.9.0",
78
+ "eslint-plugin-jsdoc": "~48.2.1",
72
79
  "eslint-plugin-prefer-arrow": "~1.2.3",
73
- "eslint-plugin-unicorn": "^50.0.0",
80
+ "eslint-plugin-unicorn": "^51.0.1",
74
81
  "jest": "~29.7.0",
75
82
  "jest-junit": "~16.0.0",
76
83
  "jsonc-eslint-parser": "~2.4.0",
77
- "nx": "~17.1.1",
84
+ "nx": "~18.3.0",
78
85
  "rimraf": "^5.0.1",
79
- "ts-jest": "~29.1.1",
80
- "type-fest": "^4.3.1",
81
- "typescript": "~5.2.2",
86
+ "ts-jest": "~29.1.2",
87
+ "type-fest": "^4.10.2",
88
+ "typescript": "~5.4.2",
82
89
  "yaml-eslint-parser": "^1.2.2"
83
90
  },
84
91
  "schematics": "./collection.json",
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "ngAddSchematicsSchema",
4
+ "title": "Add Otter eslint-plugin ",
5
+ "description": "ngAdd Otter eslint-plugin ",
6
+ "properties": {
7
+ "projectName": {
8
+ "type": "string",
9
+ "description": "Project name",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ }
14
+ },
15
+ "additionalProperties": true,
16
+ "required": [
17
+ ]
18
+ }
@@ -1,15 +1,17 @@
1
1
  interface Options {
2
2
  /** List of package name to ignore when determining the dependencies versions */
3
- ignoredPackages: string[];
3
+ ignoredPackages?: string[];
4
4
  /** List of dependencies to ignore */
5
- ignoredDependencies: string[];
5
+ ignoredDependencies?: string[];
6
6
  /** List of dependency types to update */
7
- dependencyTypes: string[];
7
+ dependencyTypes?: string[];
8
8
  /**
9
9
  * Enforce to align the version of the dependencies with the latest range.
10
10
  * If not set, the version will be aligned with the latest range if the latest range is not intersected with the current range.
11
11
  */
12
- alignPeerDependencies: boolean;
12
+ alignPeerDependencies?: boolean;
13
+ /** Align the resolutions/overrides dependency rules with the latest determined range */
14
+ alignResolutions?: boolean;
13
15
  }
14
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"error" | "versionUpdate", [Options, ...any[]], any>;
16
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"error" | "versionUpdate", [Options, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
15
17
  export default _default;
@@ -9,6 +9,7 @@ const defaultOptions = [{
9
9
  ignoredDependencies: [],
10
10
  dependencyTypes: ['optionalDependencies', 'dependencies', 'devDependencies', 'peerDependencies', 'generatorDependencies'],
11
11
  alignPeerDependencies: false,
12
+ alignResolutions: true,
12
13
  ignoredPackages: []
13
14
  }];
14
15
  exports.default = (0, utils_1.createRule)({
@@ -18,7 +19,7 @@ exports.default = (0, utils_1.createRule)({
18
19
  type: 'problem',
19
20
  docs: {
20
21
  description: 'Ensure that the package dependency versions are aligned with the other package of the workspace.',
21
- recommended: 'error'
22
+ recommended: 'strict'
22
23
  },
23
24
  schema: [
24
25
  {
@@ -49,6 +50,10 @@ exports.default = (0, utils_1.createRule)({
49
50
  items: {
50
51
  type: 'string'
51
52
  }
53
+ },
54
+ alignResolutions: {
55
+ type: 'boolean',
56
+ description: 'Align the resolutions dependencies with the latest determined range.'
52
57
  }
53
58
  },
54
59
  additionalProperties: false
@@ -62,30 +67,26 @@ exports.default = (0, utils_1.createRule)({
62
67
  },
63
68
  defaultOptions,
64
69
  create: (context, [options]) => {
70
+ const resolutionsFields = ['resolutions', 'overrides'];
65
71
  const parserServices = (0, utils_2.getJsoncParserServices)(context);
66
72
  const dirname = path.dirname(context.getFilename());
67
73
  const workspace = (0, version_harmonize_1.findWorkspacePackageJsons)(dirname);
68
74
  const bestRanges = workspace && (0, version_harmonize_1.getBestRanges)(options.dependencyTypes, workspace.packages.filter(({ content }) => !content.name || !options.ignoredPackages.includes(content.name)));
69
75
  const ignoredDependencies = options.ignoredDependencies.map((dep) => new RegExp(dep.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*')));
76
+ const dependencyTypes = [...options.dependencyTypes, ...(options.alignResolutions ? resolutionsFields : [])];
70
77
  if (parserServices.isJSON) {
71
78
  return {
72
79
  // eslint-disable-next-line @typescript-eslint/naming-convention
73
80
  'JSONExpressionStatement': (node) => {
74
81
  if (node.expression.type === 'JSONObjectExpression') {
75
82
  const deps = node.expression.properties
76
- .filter(({ key }) => options.dependencyTypes.includes(key.type === 'JSONLiteral' ? key.value.toString() : key.name));
83
+ .filter(({ key }) => dependencyTypes.includes(key.type === 'JSONLiteral' ? key.value.toString() : key.name));
77
84
  if (deps.length > 0 && bestRanges) {
78
85
  deps
79
86
  .map((depGroup) => depGroup.value)
80
87
  .filter((depGroup) => depGroup.type === 'JSONObjectExpression')
81
88
  .forEach((depGroup) => {
82
- depGroup.properties.forEach((dep) => {
83
- const name = dep.key.type === 'JSONLiteral' ? dep.key.value.toString() : dep.key.name;
84
- if (ignoredDependencies.some((ignore) => ignore.test(name))) {
85
- return;
86
- }
87
- const range = dep.value.type === 'JSONLiteral' ? dep.value.value : (dep.value.type === 'JSONIdentifier' ? dep.value.name : undefined);
88
- const bestRange = (0, version_harmonize_1.getBestRange)(range, bestRanges[name]?.range);
89
+ const report = (name, resolvedName, dep, range, bestRange) => {
89
90
  if (bestRange && bestRange !== range) {
90
91
  if (!options.alignPeerDependencies && depGroup.parent.type === 'JSONProperty' && range &&
91
92
  (depGroup.parent.key.type === 'JSONLiteral' ? depGroup.parent.key.value.toString() : depGroup.parent.key.name) === 'peerDependencies' &&
@@ -98,7 +99,7 @@ exports.default = (0, utils_1.createRule)({
98
99
  data: {
99
100
  depName: name,
100
101
  version: bestRange,
101
- packageJsonFile: bestRanges[name].path
102
+ packageJsonFile: bestRanges[resolvedName].path
102
103
  },
103
104
  fix: (fixer) => fixer.replaceTextRange(dep.value.range, `"${bestRange}"`),
104
105
  suggest: [
@@ -112,6 +113,27 @@ exports.default = (0, utils_1.createRule)({
112
113
  ]
113
114
  });
114
115
  }
116
+ };
117
+ depGroup.properties.forEach((dependencyNode) => {
118
+ const isResolutionsField = options.alignResolutions && depGroup.parent.type === 'JSONProperty' &&
119
+ resolutionsFields.includes(depGroup.parent.key.type === 'JSONLiteral' ? depGroup.parent.key.value.toString() : depGroup.parent.key.name);
120
+ const getNodeDetails = (dep) => {
121
+ const name = dep.key.type === 'JSONLiteral' ? dep.key.value.toString() : dep.key.name;
122
+ const nameParts = name.split('/');
123
+ if (ignoredDependencies.some((ignore) => ignore.test(name))) {
124
+ return;
125
+ }
126
+ const range = dep.value.type === 'JSONLiteral' ? dep.value.value : (dep.value.type === 'JSONIdentifier' ? dep.value.name : undefined);
127
+ if (!range && dep.value.type === 'JSONObjectExpression') {
128
+ return dep.value.properties
129
+ .forEach((prop) => getNodeDetails(prop));
130
+ }
131
+ const resolutionSubNameIndex = isResolutionsField ? nameParts.findIndex((_, i) => !!bestRanges[nameParts.slice(nameParts.length - i).join('/')]) : -1;
132
+ const resolvedName = resolutionSubNameIndex > -1 ? nameParts.slice(nameParts.length - resolutionSubNameIndex).join('/') : name;
133
+ const bestRange = (0, version_harmonize_1.getBestRange)(range, bestRanges[resolvedName]?.range);
134
+ report(name, resolvedName, dep, range, bestRange);
135
+ };
136
+ getNodeDetails(dependencyNode);
115
137
  });
116
138
  });
117
139
  }
@@ -119,5 +141,6 @@ exports.default = (0, utils_1.createRule)({
119
141
  }
120
142
  };
121
143
  }
144
+ return {};
122
145
  }
123
146
  });
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getBestRanges = exports.getBestRange = exports.findWorkspacePackageJsons = void 0;
4
4
  const semver = require("semver");
5
+ const fs = require("node:fs");
5
6
  const node_fs_1 = require("node:fs");
6
7
  const node_path_1 = require("node:path");
7
8
  const globby_1 = require("globby");
@@ -21,7 +22,7 @@ const findWorkspacePackageJsons = (directory, rootDir) => {
21
22
  if (!content || !content.workspaces) {
22
23
  return (0, exports.findWorkspacePackageJsons)(parentFolder, rootDir);
23
24
  }
24
- const packagePaths = (0, globby_1.sync)((Array.isArray(content.workspaces) ? content.workspaces : content.workspaces.packages || []).map((f) => node_path_1.posix.join(f, 'package.json')), { cwd: directory, onlyFiles: false, absolute: true });
25
+ const packagePaths = (0, globby_1.sync)((Array.isArray(content.workspaces) ? content.workspaces : content.workspaces.packages || []).map((f) => node_path_1.posix.join(f, 'package.json')), { cwd: directory, onlyFiles: false, absolute: true, fs });
25
26
  const isPackageWorkspace = packagePaths.some((workspacePath) => (0, node_path_1.normalize)(workspacePath) === rootDir);
26
27
  const getPackages = () => ([
27
28
  { content, path: packageJsonPath, isWorkspace: true },
@@ -1,9 +1,9 @@
1
- import { ParserServices, TSESLint } from '@typescript-eslint/experimental-utils';
1
+ import { type ParserServices, TSESLint } from '@typescript-eslint/utils';
2
2
  import type { AST } from 'jsonc-eslint-parser';
3
3
  /** Basic interface for the Parser Services object provided by jsonc-eslint-parser */
4
- interface JsoncParserServices extends ParserServices {
4
+ type JsoncParserServices = ParserServices & {
5
5
  isJSON: boolean;
6
- }
6
+ };
7
7
  /**
8
8
  * Determine if jsonc-eslint-parser is used
9
9
  * @param parserServices Parser services object
@@ -1,5 +1,5 @@
1
1
  /** Rule Name */
2
2
  export declare const name = "no-inner-html";
3
3
  type Messages = 'error' | 'fix';
4
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<Messages, [], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<Messages, [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
5
5
  export default _default;
@@ -13,7 +13,7 @@ exports.default = (0, utils_2.createRule)({
13
13
  hasSuggestions: true,
14
14
  docs: {
15
15
  description: 'Ensures that your template does not use innerHTML',
16
- recommended: 'warn'
16
+ recommended: 'recommended'
17
17
  },
18
18
  schema: [],
19
19
  messages: {
@@ -3,5 +3,5 @@ interface Options {
3
3
  }
4
4
  /** Rule Name */
5
5
  export declare const name = "template-async-number-limitation";
6
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"tooManyAsyncOnTag", [Options, ...any[]], any>;
6
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"tooManyAsyncOnTag", [Options, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
7
7
  export default _default;
@@ -15,7 +15,7 @@ exports.default = (0, utils_2.createRule)({
15
15
  hasSuggestions: true,
16
16
  docs: {
17
17
  description: 'Ensures that your template does not use too many Async pipes that can slow down your application.',
18
- recommended: 'error'
18
+ recommended: 'strict'
19
19
  },
20
20
  schema: [
21
21
  {
@@ -1,4 +1,4 @@
1
- import { ParserServices, TSESLint } from '@typescript-eslint/experimental-utils';
1
+ import { type ParserServices, TSESLint } from '@typescript-eslint/utils';
2
2
  /** Position in source code */
3
3
  interface SourceSpan {
4
4
  /** starting position */
@@ -13,12 +13,12 @@ interface SourceSpan {
13
13
  };
14
14
  }
15
15
  /** Basic interface for the Parser Services object provided by @angular-eslint/template-parser */
16
- interface TemplateParserServices extends ParserServices {
16
+ type TemplateParserServices = ParserServices & {
17
17
  /** Set body visitor rule runner */
18
18
  convertElementSourceSpanToLoc: (listenerObj: any) => any;
19
19
  /** Determine the linter notification position based on the node */
20
20
  convertNodeSourceSpanToLoc: (sourceSpan: SourceSpan) => any;
21
- }
21
+ };
22
22
  /**
23
23
  * Determine if @angular-eslint/template-parser is used
24
24
  * @param parserServices Parser services object
@@ -1,5 +1,2 @@
1
- import { TSESTree } from '@typescript-eslint/experimental-utils';
2
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"suggestion" | "error", never[], {
3
- CallExpression: (node: TSESTree.CallExpression) => void;
4
- }>;
1
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"suggestion" | "error", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
5
2
  export default _default;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
4
- const utils_1 = require("../../utils");
3
+ const utils_1 = require("@typescript-eslint/utils");
4
+ const utils_2 = require("../../utils");
5
5
  const nameDeterminingFunctionNames = ['computeItemIdentifier', 'computeConfigurationName'];
6
- exports.default = (0, utils_1.createRule)({
6
+ exports.default = (0, utils_2.createRule)({
7
7
  name: 'matching-configuration-name',
8
8
  meta: {
9
9
  hasSuggestions: true,
@@ -12,7 +12,7 @@ exports.default = (0, utils_1.createRule)({
12
12
  docs: {
13
13
  // eslint-disable-next-line max-len
14
14
  description: 'Ensures that the configuration interface name matches the first parameter of `computeItemIdentifier` (or `computeConfigurationName`) used beside the configuration interface to expose its ID (as generated by the configuration module).',
15
- recommended: 'error'
15
+ recommended: 'strict'
16
16
  },
17
17
  schema: [],
18
18
  messages: {
@@ -25,18 +25,18 @@ exports.default = (0, utils_1.createRule)({
25
25
  return {
26
26
  // eslint-disable-next-line @typescript-eslint/naming-convention
27
27
  CallExpression: (node) => {
28
- if (node.callee.type !== experimental_utils_1.TSESTree.AST_NODE_TYPES.Identifier
28
+ if (node.callee.type !== utils_1.TSESTree.AST_NODE_TYPES.Identifier
29
29
  || !nameDeterminingFunctionNames.includes(node.callee.name)
30
30
  || !node.arguments.length
31
- || node.arguments[0].type !== experimental_utils_1.TSESTree.AST_NODE_TYPES.Literal
31
+ || node.arguments[0].type !== utils_1.TSESTree.AST_NODE_TYPES.Literal
32
32
  || typeof node.arguments[0].value !== 'string') {
33
33
  return;
34
34
  }
35
35
  const sourceCode = context.getSourceCode();
36
36
  const interfaceNames = sourceCode.ast.body
37
- .filter((statement) => statement.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration
38
- && statement.declaration?.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.TSInterfaceDeclaration
39
- && (statement.declaration.extends || []).some((heritageClause) => heritageClause.expression.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.Identifier
37
+ .filter((statement) => statement.type === utils_1.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration
38
+ && statement.declaration?.type === utils_1.TSESTree.AST_NODE_TYPES.TSInterfaceDeclaration
39
+ && (statement.declaration.extends || []).some((heritageClause) => heritageClause.expression.type === utils_1.TSESTree.AST_NODE_TYPES.Identifier
40
40
  && heritageClause.expression.name === 'Configuration'))
41
41
  .map((statement) => statement.declaration.id.name);
42
42
  const fnArgInterfaceName = node.arguments[0].value;
@@ -1,4 +1,2 @@
1
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"error" | "indexFile", never[], {
2
- ImportDeclaration: (node: import("@typescript-eslint/types/dist/generated/ast-spec").ImportDeclaration) => void;
3
- }>;
1
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"error" | "indexFile", [], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
4
2
  export default _default;
@@ -10,7 +10,7 @@ exports.default = (0, utils_1.createRule)({
10
10
  type: 'problem',
11
11
  docs: {
12
12
  description: 'Ensures that imports of modules are pointing to the module file or an index.',
13
- recommended: 'error'
13
+ recommended: 'strict'
14
14
  },
15
15
  schema: [],
16
16
  messages: {
@@ -1,5 +1,5 @@
1
1
  export interface NoMultipleTypeConfigurationPropertyOption {
2
2
  supportedInterfaceNames?: string[];
3
3
  }
4
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"suggestion" | "error", [Required<NoMultipleTypeConfigurationPropertyOption>, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
4
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"suggestion" | "error", [Required<NoMultipleTypeConfigurationPropertyOption>, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
5
5
  export default _default;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
4
- const utils_1 = require("../../utils");
3
+ const utils_1 = require("@typescript-eslint/utils");
4
+ const utils_2 = require("../../utils");
5
5
  const separatorRegExp = /\s*[|&]\s*/;
6
- exports.default = (0, utils_1.createRule)({
6
+ exports.default = (0, utils_2.createRule)({
7
7
  name: 'no-multiple-type-configuration-property',
8
8
  meta: {
9
9
  hasSuggestions: true,
10
10
  type: 'problem',
11
11
  docs: {
12
12
  description: 'Ensures that the configuration property does not accept multiple types.',
13
- recommended: 'error'
13
+ recommended: 'strict'
14
14
  },
15
15
  schema: [
16
16
  {
@@ -21,7 +21,7 @@ exports.default = (0, utils_1.createRule)({
21
21
  items: {
22
22
  type: 'string'
23
23
  },
24
- default: utils_1.defaultSupportedInterfaceNames
24
+ default: utils_2.defaultSupportedInterfaceNames
25
25
  }
26
26
  }
27
27
  }
@@ -32,17 +32,17 @@ exports.default = (0, utils_1.createRule)({
32
32
  }
33
33
  },
34
34
  defaultOptions: [{
35
- supportedInterfaceNames: utils_1.defaultSupportedInterfaceNames
35
+ supportedInterfaceNames: utils_2.defaultSupportedInterfaceNames
36
36
  }],
37
37
  create: (context, [options]) => {
38
38
  const supportedInterfaceNames = options.supportedInterfaceNames;
39
39
  const sourceCode = context.getSourceCode();
40
40
  const rule = (node) => {
41
41
  const interfaceDeclNode = node.parent?.parent?.parent?.parent;
42
- if (!(0, utils_1.isExtendingConfiguration)(interfaceDeclNode, supportedInterfaceNames)) {
42
+ if (!(0, utils_2.isExtendingConfiguration)(interfaceDeclNode, supportedInterfaceNames)) {
43
43
  return; // Not in a configuration interface
44
44
  }
45
- if (node.types.every((type) => type.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.TSLiteralType && type.literal.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.Literal)
45
+ if (node.types.every((type) => type.type === utils_1.TSESTree.AST_NODE_TYPES.TSLiteralType && type.literal.type === utils_1.TSESTree.AST_NODE_TYPES.Literal)
46
46
  && [...(new Set(node.types.map((literalType) => typeof literalType.literal.value)))].length === 1) {
47
47
  return; // Only the same literal type
48
48
  }
@@ -3,5 +3,5 @@ export interface O3rCategoriesTagsRuleOption {
3
3
  globalConfigCategories?: string[];
4
4
  }
5
5
  type Messages = 'alreadyDefined' | 'undefinedCategory' | 'onlyOneCategoryAllowed' | 'notInConfigurationInterface' | 'suggestReplaceO3rCategory';
6
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<Messages, [O3rCategoriesTagsRuleOption, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>;
6
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<Messages, readonly [O3rCategoriesTagsRuleOption, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
7
7
  export default _default;
@@ -9,7 +9,7 @@ exports.default = (0, utils_1.createRule)({
9
9
  type: 'problem',
10
10
  docs: {
11
11
  description: 'Ensures that @o3rCategories and @o3rCategory are used with correct value',
12
- recommended: 'error'
12
+ recommended: 'strict'
13
13
  },
14
14
  schema: [
15
15
  {
@@ -1,8 +1,8 @@
1
- import { TSESLint } from '@typescript-eslint/experimental-utils';
1
+ import { TSESLint } from '@typescript-eslint/utils';
2
2
  type O3rWidgetParamType = 'string' | 'number' | 'boolean' | 'string[]' | 'number[]' | 'boolean[]';
3
3
  export interface O3rWidgetTagsRuleOption {
4
4
  supportedInterfaceNames?: string[];
5
- widgets: {
5
+ widgets?: {
6
6
  [widgetName: string]: {
7
7
  [paramName: string]: {
8
8
  type: O3rWidgetParamType;
@@ -12,5 +12,5 @@ export interface O3rWidgetTagsRuleOption {
12
12
  };
13
13
  }
14
14
  type O3rWidgetRuleErrorId = 'notInConfigurationInterface' | 'notSupportedType' | 'notSupportedParamForType' | 'invalidParamValueType' | 'noParamWithoutWidget' | 'onlyOneWidgetAllowed' | 'duplicatedParam' | 'requiredParamMissing' | 'suggestParamMissing' | 'suggestRemoveDuplicatedO3rWidget' | 'suggestRemoveDuplicatedO3rWidgetParam' | 'suggestAddO3rWidgetTag' | 'suggestReplaceO3rWidgetType';
15
- declare const _default: TSESLint.RuleModule<O3rWidgetRuleErrorId, [Required<O3rWidgetTagsRuleOption>, ...any[]], TSESLint.RuleListener>;
15
+ declare const _default: TSESLint.RuleModule<O3rWidgetRuleErrorId, [Readonly<O3rWidgetTagsRuleOption>, ...any[]], TSESLint.RuleListener>;
16
16
  export default _default;
@@ -15,7 +15,7 @@ exports.default = (0, utils_1.createRule)({
15
15
  type: 'problem',
16
16
  docs: {
17
17
  description: 'Ensures that @o3rWidget and @o3rWidgetParam are used with correct value',
18
- recommended: 'error'
18
+ recommended: 'strict'
19
19
  },
20
20
  schema: [
21
21
  {
@@ -30,6 +30,7 @@ exports.default = (0, utils_1.createRule)({
30
30
  default: utils_1.defaultSupportedInterfaceNames
31
31
  },
32
32
  widgets: {
33
+ type: 'object',
33
34
  additionalProperties: {
34
35
  type: 'object',
35
36
  additionalProperties: false,
@@ -1,6 +1,6 @@
1
- import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
1
+ import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';
2
2
  /** ESLint rule generator */
3
- export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends TSESLint.RuleListener = TSESLint.RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => TSESLint.RuleModule<TMessageIds, TOptions, TRuleListener>;
3
+ export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds>>) => ESLintUtils.RuleModule<MessageIds, Options, ESLintUtils.RuleListener>;
4
4
  /** Default supported interface names */
5
5
  export declare const defaultSupportedInterfaceNames: string[];
6
6
  /**
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createCommentString = exports.getNodeComment = exports.isExtendingConfiguration = exports.defaultSupportedInterfaceNames = exports.createRule = void 0;
4
- const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
4
+ const utils_1 = require("@typescript-eslint/utils");
5
5
  const path = require("node:path");
6
6
  /** Current package version (format: <major>.<minor>)*/
7
7
  const version = require(path.resolve(__dirname, '..', '..', 'package.json')).version.split('.').slice(0, 2).join('.');
8
8
  /** ESLint rule generator */
9
9
  // eslint-disable-next-line new-cap
10
- exports.createRule = experimental_utils_1.ESLintUtils.RuleCreator((name) => {
10
+ exports.createRule = utils_1.ESLintUtils.RuleCreator((name) => {
11
11
  if (version === '0.0') {
12
12
  return 'file:' + path.resolve(__dirname, '..', '..', '..', '..', '..', 'docs', 'linter', 'eslint-plugin', 'rules', `${name}.md`);
13
13
  }
@@ -22,9 +22,9 @@ exports.defaultSupportedInterfaceNames = ['Configuration', 'NestedConfiguration'
22
22
  */
23
23
  const isExtendingConfiguration = (interfaceDeclNode, supportedInterfaceNames = []) => {
24
24
  const supportedInterfaceNamesSet = new Set(supportedInterfaceNames.length > 0 ? supportedInterfaceNames : exports.defaultSupportedInterfaceNames);
25
- return interfaceDeclNode?.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.TSInterfaceDeclaration
26
- && !!interfaceDeclNode.extends?.some((ext) => ext.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.TSInterfaceHeritage
27
- && ext.expression.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.Identifier
25
+ return interfaceDeclNode?.type === utils_1.TSESTree.AST_NODE_TYPES.TSInterfaceDeclaration
26
+ && !!interfaceDeclNode.extends?.some((ext) => ext.type === utils_1.TSESTree.AST_NODE_TYPES.TSInterfaceHeritage
27
+ && ext.expression.type === utils_1.TSESTree.AST_NODE_TYPES.Identifier
28
28
  && supportedInterfaceNamesSet.has(ext.expression.name));
29
29
  };
30
30
  exports.isExtendingConfiguration = isExtendingConfiguration;
@@ -34,7 +34,7 @@ exports.isExtendingConfiguration = isExtendingConfiguration;
34
34
  * @param sourceCode
35
35
  */
36
36
  const getNodeComment = (node, sourceCode) => {
37
- const [comment] = node.parent?.type === experimental_utils_1.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration
37
+ const [comment] = node.parent?.type === utils_1.TSESTree.AST_NODE_TYPES.ExportNamedDeclaration
38
38
  ? sourceCode.getCommentsBefore(node.parent)
39
39
  : sourceCode.getCommentsBefore(node);
40
40
  return comment;
@@ -1,8 +1,8 @@
1
- import { ParserServices, TSESLint } from '@typescript-eslint/experimental-utils';
1
+ import { type ParserServices, TSESLint } from '@typescript-eslint/utils';
2
2
  /** Basic interface for the Parser Services object provided by yaml-eslint-parser */
3
- interface YamlParserServices extends ParserServices {
3
+ type YamlParserServices = ParserServices & {
4
4
  isYAML: boolean;
5
- }
5
+ };
6
6
  /**
7
7
  * Determine if yaml-eslint-parser is used
8
8
  * @param parserServices Parser services object
@@ -8,5 +8,5 @@ interface Options {
8
8
  /** List of dependency types to validate in .yarnrc.yml */
9
9
  yarnrcDependencyTypes: string[];
10
10
  }
11
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"error" | "versionUpdate", [Options, ...any[]], any>;
11
+ declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"error" | "versionUpdate", [Options, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
12
12
  export default _default;
@@ -19,7 +19,7 @@ exports.default = (0, utils_1.createRule)({
19
19
  type: 'problem',
20
20
  docs: {
21
21
  description: 'Ensure that the package extension versions are aligned with range defined in packages.',
22
- recommended: 'error'
22
+ recommended: 'strict'
23
23
  },
24
24
  schema: [
25
25
  {
@@ -118,5 +118,6 @@ exports.default = (0, utils_1.createRule)({
118
118
  }
119
119
  };
120
120
  }
121
+ return {};
121
122
  }
122
123
  });
@@ -1 +1 @@
1
- {"version":"5.2.2"}
1
+ {"version":"5.4.5"}