@typescript-eslint/eslint-plugin 8.32.1-alpha.4 → 8.32.1-alpha.5
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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"no-deprecated.d.ts","sourceRoot":"","sources":["../../src/rules/no-deprecated.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAgBpD,KAAK,UAAU,GAAG,YAAY,GAAG,sBAAsB,CAAC;AAExD,KAAK,OAAO,GAAG;IACb;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;KAChC;CACF,CAAC;;AAEF,
|
1
|
+
{"version":3,"file":"no-deprecated.d.ts","sourceRoot":"","sources":["../../src/rules/no-deprecated.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAgBpD,KAAK,UAAU,GAAG,YAAY,GAAG,sBAAsB,CAAC;AAExD,KAAK,OAAO,GAAG;IACb;QACE,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;KAChC;CACF,CAAC;;AAEF,wBAmaG"}
|
@@ -318,6 +318,38 @@ exports.default = (0, util_1.createRule)({
|
|
318
318
|
node,
|
319
319
|
});
|
320
320
|
}
|
321
|
+
function checkMemberExpression(node) {
|
322
|
+
if (!node.computed) {
|
323
|
+
return;
|
324
|
+
}
|
325
|
+
const propertyType = services.getTypeAtLocation(node.property);
|
326
|
+
if (propertyType.isLiteral()) {
|
327
|
+
const objectType = services.getTypeAtLocation(node.object);
|
328
|
+
const propertyName = propertyType.isStringLiteral()
|
329
|
+
? propertyType.value
|
330
|
+
: String(propertyType.value);
|
331
|
+
const property = objectType.getProperty(propertyName);
|
332
|
+
const reason = getJsDocDeprecation(property);
|
333
|
+
if (reason == null) {
|
334
|
+
return;
|
335
|
+
}
|
336
|
+
if ((0, util_1.typeMatchesSomeSpecifier)(objectType, allow, services.program)) {
|
337
|
+
return;
|
338
|
+
}
|
339
|
+
context.report({
|
340
|
+
...(reason
|
341
|
+
? {
|
342
|
+
messageId: 'deprecatedWithReason',
|
343
|
+
data: { name: propertyName, reason },
|
344
|
+
}
|
345
|
+
: {
|
346
|
+
messageId: 'deprecated',
|
347
|
+
data: { name: propertyName },
|
348
|
+
}),
|
349
|
+
node: node.property,
|
350
|
+
});
|
351
|
+
}
|
352
|
+
}
|
321
353
|
return {
|
322
354
|
Identifier: checkIdentifier,
|
323
355
|
JSXIdentifier(node) {
|
@@ -325,6 +357,7 @@ exports.default = (0, util_1.createRule)({
|
|
325
357
|
checkIdentifier(node);
|
326
358
|
}
|
327
359
|
},
|
360
|
+
MemberExpression: checkMemberExpression,
|
328
361
|
PrivateIdentifier: checkIdentifier,
|
329
362
|
Super: checkIdentifier,
|
330
363
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@typescript-eslint/eslint-plugin",
|
3
|
-
"version": "8.32.1-alpha.
|
3
|
+
"version": "8.32.1-alpha.5",
|
4
4
|
"description": "TypeScript plugin for ESLint",
|
5
5
|
"files": [
|
6
6
|
"dist",
|
@@ -61,10 +61,10 @@
|
|
61
61
|
},
|
62
62
|
"dependencies": {
|
63
63
|
"@eslint-community/regexpp": "^4.10.0",
|
64
|
-
"@typescript-eslint/scope-manager": "8.32.1-alpha.
|
65
|
-
"@typescript-eslint/type-utils": "8.32.1-alpha.
|
66
|
-
"@typescript-eslint/utils": "8.32.1-alpha.
|
67
|
-
"@typescript-eslint/visitor-keys": "8.32.1-alpha.
|
64
|
+
"@typescript-eslint/scope-manager": "8.32.1-alpha.5",
|
65
|
+
"@typescript-eslint/type-utils": "8.32.1-alpha.5",
|
66
|
+
"@typescript-eslint/utils": "8.32.1-alpha.5",
|
67
|
+
"@typescript-eslint/visitor-keys": "8.32.1-alpha.5",
|
68
68
|
"graphemer": "^1.4.0",
|
69
69
|
"ignore": "^7.0.0",
|
70
70
|
"natural-compare": "^1.4.0",
|
@@ -73,8 +73,8 @@
|
|
73
73
|
"devDependencies": {
|
74
74
|
"@types/mdast": "^4.0.3",
|
75
75
|
"@types/natural-compare": "*",
|
76
|
-
"@typescript-eslint/rule-schema-to-typescript-types": "8.32.1-alpha.
|
77
|
-
"@typescript-eslint/rule-tester": "8.32.1-alpha.
|
76
|
+
"@typescript-eslint/rule-schema-to-typescript-types": "8.32.1-alpha.5",
|
77
|
+
"@typescript-eslint/rule-tester": "8.32.1-alpha.5",
|
78
78
|
"@vitest/coverage-v8": "^3.1.3",
|
79
79
|
"ajv": "^6.12.6",
|
80
80
|
"cross-fetch": "*",
|