eslint-plugin-class-validator-type-match 4.1.12 → 4.2.0
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.
|
@@ -110,13 +110,12 @@ exports.default = createRule({
|
|
|
110
110
|
})
|
|
111
111
|
.filter((name) => name !== null);
|
|
112
112
|
const { typeAnnotation } = node.typeAnnotation;
|
|
113
|
-
let actualType = null;
|
|
114
113
|
/**
|
|
115
114
|
* Determine the actual TypeScript type from the annotation.
|
|
116
115
|
* Supports primitive types, arrays, type references, literals, and intersections.
|
|
117
116
|
* Uses TypeScript's type checker when available to resolve type aliases.
|
|
118
117
|
*/
|
|
119
|
-
actualType = (0, type_helpers_util_1.getTypeString)(typeAnnotation, checker, esTreeNodeMap);
|
|
118
|
+
const actualType = (0, type_helpers_util_1.getTypeString)(typeAnnotation, checker, esTreeNodeMap);
|
|
120
119
|
// Skip if we couldn't determine the type
|
|
121
120
|
if (!actualType)
|
|
122
121
|
return;
|
|
@@ -254,8 +254,7 @@ exports.default = createRule({
|
|
|
254
254
|
const typeNode = node.typeAnnotation.typeAnnotation;
|
|
255
255
|
if (typeNode.type !== 'TSUnionType')
|
|
256
256
|
return null;
|
|
257
|
-
const
|
|
258
|
-
const typeText = sourceCode.getText(typeNode);
|
|
257
|
+
const typeText = context.sourceCode.getText(typeNode);
|
|
259
258
|
// Remove | undefined or undefined | from the union
|
|
260
259
|
const fixedType = typeText
|
|
261
260
|
.replace(/\s*\|\s*undefined\s*$/, '')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-class-validator-type-match",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "ESLint plugin to ensure class-validator decorators match TypeScript type annotations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -34,28 +34,28 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@typescript-eslint/parser": "^8.0.0",
|
|
37
|
-
"eslint": "^9.0.0"
|
|
37
|
+
"eslint": "^9.0.0 || ^10.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@typescript-eslint/utils": "8.
|
|
40
|
+
"@typescript-eslint/utils": "8.62.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@commitlint/cli": "21.0.2",
|
|
44
44
|
"@commitlint/config-conventional": "21.0.2",
|
|
45
|
-
"@eslint/js": "
|
|
46
|
-
"@typescript-eslint/parser": "8.
|
|
47
|
-
"@typescript-eslint/rule-tester": "8.
|
|
45
|
+
"@eslint/js": "^10.0.1",
|
|
46
|
+
"@typescript-eslint/parser": "8.62.0",
|
|
47
|
+
"@typescript-eslint/rule-tester": "8.62.0",
|
|
48
48
|
"@vitest/coverage-v8": "4.1.9",
|
|
49
|
-
"eslint": "
|
|
50
|
-
"globals": "17.
|
|
49
|
+
"eslint": "^10.5.0",
|
|
50
|
+
"globals": "17.7.0",
|
|
51
51
|
"husky": "9.1.7",
|
|
52
|
-
"lint-staged": "17.0.
|
|
52
|
+
"lint-staged": "17.0.8",
|
|
53
53
|
"prettier": "3.8.4",
|
|
54
54
|
"typescript": "5.9.3",
|
|
55
|
-
"typescript-eslint": "8.
|
|
55
|
+
"typescript-eslint": "8.62.0",
|
|
56
56
|
"vitest": "4.1.9"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
|
-
"node": "
|
|
59
|
+
"node": ">=20"
|
|
60
60
|
}
|
|
61
61
|
}
|