@o3r/eslint-plugin 10.2.0-prerelease.26 → 10.2.0-prerelease.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +22 -22
- package/src/rules/json/json-dependency-versions-harmonize/json-dependency-versions-harmonize.d.ts +6 -6
- package/src/rules/json/json-dependency-versions-harmonize/json-dependency-versions-harmonize.js +2 -1
- package/src/rules/json/utils.d.ts +3 -3
- package/src/rules/template/no-inner-html/no-inner-html.d.ts +1 -1
- package/src/rules/template/no-inner-html/no-inner-html.js +1 -1
- package/src/rules/template/template-async-number-limitation/template-async-number-limitation.d.ts +1 -1
- package/src/rules/template/template-async-number-limitation/template-async-number-limitation.js +1 -1
- package/src/rules/template/utils.d.ts +3 -3
- package/src/rules/typescript/matching-configuration-name/matching-configuration-name.d.ts +1 -4
- package/src/rules/typescript/matching-configuration-name/matching-configuration-name.js +9 -9
- package/src/rules/typescript/no-folder-import-for-module/no-folder-import-for-module.d.ts +1 -3
- package/src/rules/typescript/no-folder-import-for-module/no-folder-import-for-module.js +1 -1
- package/src/rules/typescript/no-multiple-type-configuration-property/no-multiple-type-configuration-property.d.ts +1 -1
- package/src/rules/typescript/no-multiple-type-configuration-property/no-multiple-type-configuration-property.js +8 -8
- package/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.d.ts +1 -1
- package/src/rules/typescript/o3r-categories-tags/o3r-categories-tags.js +1 -1
- package/src/rules/typescript/o3r-widget-tags/o3r-widget-tags.d.ts +3 -3
- package/src/rules/typescript/o3r-widget-tags/o3r-widget-tags.js +2 -1
- package/src/rules/utils.d.ts +2 -2
- package/src/rules/utils.js +6 -6
- package/src/rules/yaml/utils.d.ts +3 -3
- package/src/rules/yaml/yarnrc-package-extensions-harmonize/yarnrc-package-extensions-harmonize.d.ts +1 -1
- package/src/rules/yaml/yarnrc-package-extensions-harmonize/yarnrc-package-extensions-harmonize.js +2 -1
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3r/eslint-plugin",
|
|
3
|
-
"version": "10.2.0-prerelease.
|
|
3
|
+
"version": "10.2.0-prerelease.28",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@typescript-eslint/
|
|
27
|
+
"@typescript-eslint/utils": "~7.2.0",
|
|
28
28
|
"globby": "^11.1.0",
|
|
29
29
|
"semver": "^7.5.2",
|
|
30
|
-
"tslib": "^2.
|
|
30
|
+
"tslib": "^2.6.2",
|
|
31
31
|
"type-fest": "^4.10.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependenciesMeta": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@angular-eslint/template-parser": "~17.2.0",
|
|
46
46
|
"@angular-eslint/utils": "~17.2.0",
|
|
47
|
-
"@angular/compiler": "~17.
|
|
47
|
+
"@angular/compiler": "~17.3.0",
|
|
48
48
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
|
49
49
|
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
50
50
|
"@typescript-eslint/parser": "^7.0.1",
|
|
@@ -53,39 +53,39 @@
|
|
|
53
53
|
"yaml-eslint-parser": "^1.2.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@angular-devkit/core": "~17.
|
|
57
|
-
"@angular-devkit/schematics": "~17.
|
|
58
|
-
"@angular-eslint/eslint-plugin": "~17.2.
|
|
59
|
-
"@angular-eslint/template-parser": "~17.2.
|
|
56
|
+
"@angular-devkit/core": "~17.3.0",
|
|
57
|
+
"@angular-devkit/schematics": "~17.3.0",
|
|
58
|
+
"@angular-eslint/eslint-plugin": "~17.2.1",
|
|
59
|
+
"@angular-eslint/template-parser": "~17.2.1",
|
|
60
60
|
"@angular-eslint/utils": "~17.2.0",
|
|
61
|
-
"@angular/compiler": "~17.
|
|
61
|
+
"@angular/compiler": "~17.3.0",
|
|
62
62
|
"@babel/core": "~7.24.0",
|
|
63
|
-
"@babel/preset-typescript": "~7.23.
|
|
63
|
+
"@babel/preset-typescript": "~7.23.3",
|
|
64
64
|
"@compodoc/compodoc": "^1.1.19",
|
|
65
|
-
"@nx/eslint-plugin": "~18.0.
|
|
66
|
-
"@nx/jest": "~18.0.
|
|
67
|
-
"@o3r/build-helpers": "^10.2.0-prerelease.
|
|
68
|
-
"@o3r/test-helpers": "^10.2.0-prerelease.
|
|
65
|
+
"@nx/eslint-plugin": "~18.0.8",
|
|
66
|
+
"@nx/jest": "~18.0.8",
|
|
67
|
+
"@o3r/build-helpers": "^10.2.0-prerelease.28",
|
|
68
|
+
"@o3r/test-helpers": "^10.2.0-prerelease.28",
|
|
69
69
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
|
70
70
|
"@types/jest": "~29.5.2",
|
|
71
71
|
"@types/node": "^20.0.0",
|
|
72
72
|
"@types/semver": "^7.3.13",
|
|
73
|
-
"@typescript-eslint/eslint-plugin": "^7.0
|
|
74
|
-
"@typescript-eslint/parser": "^7.0
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
74
|
+
"@typescript-eslint/parser": "^7.2.0",
|
|
75
75
|
"cpy-cli": "^5.0.0",
|
|
76
|
-
"eslint": "^8.
|
|
76
|
+
"eslint": "^8.57.0",
|
|
77
77
|
"eslint-plugin-jest": "~27.9.0",
|
|
78
|
-
"eslint-plugin-jsdoc": "~48.2.
|
|
78
|
+
"eslint-plugin-jsdoc": "~48.2.1",
|
|
79
79
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
|
80
|
-
"eslint-plugin-unicorn": "^51.0.
|
|
80
|
+
"eslint-plugin-unicorn": "^51.0.1",
|
|
81
81
|
"jest": "~29.7.0",
|
|
82
82
|
"jest-junit": "~16.0.0",
|
|
83
83
|
"jsonc-eslint-parser": "~2.4.0",
|
|
84
|
-
"nx": "~18.0.
|
|
84
|
+
"nx": "~18.0.8",
|
|
85
85
|
"rimraf": "^5.0.1",
|
|
86
|
-
"ts-jest": "~29.1.
|
|
86
|
+
"ts-jest": "~29.1.2",
|
|
87
87
|
"type-fest": "^4.10.2",
|
|
88
|
-
"typescript": "~5.
|
|
88
|
+
"typescript": "~5.4.2",
|
|
89
89
|
"yaml-eslint-parser": "^1.2.2"
|
|
90
90
|
},
|
|
91
91
|
"schematics": "./collection.json",
|
package/src/rules/json/json-dependency-versions-harmonize/json-dependency-versions-harmonize.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
interface Options {
|
|
2
2
|
/** List of package name to ignore when determining the dependencies versions */
|
|
3
|
-
ignoredPackages
|
|
3
|
+
ignoredPackages?: string[];
|
|
4
4
|
/** List of dependencies to ignore */
|
|
5
|
-
ignoredDependencies
|
|
5
|
+
ignoredDependencies?: string[];
|
|
6
6
|
/** List of dependency types to update */
|
|
7
|
-
dependencyTypes
|
|
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
|
|
12
|
+
alignPeerDependencies?: boolean;
|
|
13
13
|
/** Align the resolutions/overrides dependency rules with the latest determined range */
|
|
14
|
-
alignResolutions
|
|
14
|
+
alignResolutions?: boolean;
|
|
15
15
|
}
|
|
16
|
-
declare const _default: import("@typescript-eslint/utils/dist/ts-eslint
|
|
16
|
+
declare const _default: import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<"error" | "versionUpdate", [Options, ...any[]], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
|
|
17
17
|
export default _default;
|
package/src/rules/json/json-dependency-versions-harmonize/json-dependency-versions-harmonize.js
CHANGED
|
@@ -19,7 +19,7 @@ exports.default = (0, utils_1.createRule)({
|
|
|
19
19
|
type: 'problem',
|
|
20
20
|
docs: {
|
|
21
21
|
description: 'Ensure that the package dependency versions are aligned with the other package of the workspace.',
|
|
22
|
-
recommended: '
|
|
22
|
+
recommended: 'strict'
|
|
23
23
|
},
|
|
24
24
|
schema: [
|
|
25
25
|
{
|
|
@@ -141,5 +141,6 @@ exports.default = (0, utils_1.createRule)({
|
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
+
return {};
|
|
144
145
|
}
|
|
145
146
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ParserServices, TSESLint } from '@typescript-eslint/
|
|
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
|
-
|
|
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
|
|
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;
|
package/src/rules/template/template-async-number-limitation/template-async-number-limitation.d.ts
CHANGED
|
@@ -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
|
|
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;
|
package/src/rules/template/template-async-number-limitation/template-async-number-limitation.js
CHANGED
|
@@ -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: '
|
|
18
|
+
recommended: 'strict'
|
|
19
19
|
},
|
|
20
20
|
schema: [
|
|
21
21
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParserServices, TSESLint } from '@typescript-eslint/
|
|
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
|
-
|
|
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
|
|
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
|
|
4
|
-
const
|
|
3
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
4
|
+
const utils_2 = require("../../utils");
|
|
5
5
|
const nameDeterminingFunctionNames = ['computeItemIdentifier', 'computeConfigurationName'];
|
|
6
|
-
exports.default = (0,
|
|
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: '
|
|
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 !==
|
|
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 !==
|
|
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 ===
|
|
38
|
-
&& statement.declaration?.type ===
|
|
39
|
-
&& (statement.declaration.extends || []).some((heritageClause) => heritageClause.expression.type ===
|
|
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
|
|
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;
|
|
@@ -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
|
|
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
|
|
4
|
-
const
|
|
3
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
4
|
+
const utils_2 = require("../../utils");
|
|
5
5
|
const separatorRegExp = /\s*[|&]\s*/;
|
|
6
|
-
exports.default = (0,
|
|
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: '
|
|
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:
|
|
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:
|
|
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,
|
|
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 ===
|
|
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
|
|
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;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TSESLint } from '@typescript-eslint/
|
|
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, [
|
|
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: '
|
|
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,
|
package/src/rules/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/
|
|
1
|
+
import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils';
|
|
2
2
|
/** ESLint rule generator */
|
|
3
|
-
export declare const createRule: <
|
|
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
|
/**
|
package/src/rules/utils.js
CHANGED
|
@@ -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
|
|
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 =
|
|
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 ===
|
|
26
|
-
&& !!interfaceDeclNode.extends?.some((ext) => ext.type ===
|
|
27
|
-
&& ext.expression.type ===
|
|
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 ===
|
|
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/
|
|
1
|
+
import { type ParserServices, TSESLint } from '@typescript-eslint/utils';
|
|
2
2
|
/** Basic interface for the Parser Services object provided by yaml-eslint-parser */
|
|
3
|
-
|
|
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
|
package/src/rules/yaml/yarnrc-package-extensions-harmonize/yarnrc-package-extensions-harmonize.d.ts
CHANGED
|
@@ -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
|
|
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;
|
package/src/rules/yaml/yarnrc-package-extensions-harmonize/yarnrc-package-extensions-harmonize.js
CHANGED
|
@@ -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: '
|
|
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
|
});
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.4.2"}
|