@typescript-eslint/eslint-plugin
Advanced tools
Comparing version 8.5.1-alpha.5 to 8.5.1-alpha.6
@@ -153,2 +153,3 @@ "use strict"; | ||
const signature = checker.getResolvedSignature(tsNode); | ||
const symbol = services.getSymbolAtLocation(node); | ||
if (signature) { | ||
@@ -159,5 +160,18 @@ const signatureDeprecation = getJsDocDeprecation(signature); | ||
} | ||
// Properties with function-like types have "deprecated" jsdoc | ||
// on their symbols, not on their signatures: | ||
// | ||
// interface Props { | ||
// /** @deprecated */ | ||
// property: () => 'foo' | ||
// ^symbol^ ^signature^ | ||
// } | ||
const symbolDeclarationKind = symbol?.declarations?.[0].kind; | ||
if (symbolDeclarationKind !== ts.SyntaxKind.MethodDeclaration && | ||
symbolDeclarationKind !== ts.SyntaxKind.FunctionDeclaration && | ||
symbolDeclarationKind !== ts.SyntaxKind.MethodSignature) { | ||
return getJsDocDeprecation(symbol); | ||
} | ||
} | ||
// Or it could be a ClassDeclaration or a variable set to a ClassExpression. | ||
const symbol = services.getSymbolAtLocation(node); | ||
const symbolAtLocation = symbol && checker.getTypeOfSymbolAtLocation(symbol, tsNode).getSymbol(); | ||
@@ -170,4 +184,3 @@ return symbolAtLocation && | ||
function getSymbol(node) { | ||
if (node.parent.type === utils_1.AST_NODE_TYPES.AssignmentPattern || | ||
node.parent.type === utils_1.AST_NODE_TYPES.Property) { | ||
if (node.parent.type === utils_1.AST_NODE_TYPES.Property) { | ||
return services | ||
@@ -174,0 +187,0 @@ .getTypeAtLocation(node.parent.parent) |
{ | ||
"name": "@typescript-eslint/eslint-plugin", | ||
"version": "8.5.1-alpha.5", | ||
"version": "8.5.1-alpha.6", | ||
"description": "TypeScript plugin for ESLint", | ||
@@ -63,6 +63,6 @@ "files": [ | ||
"@eslint-community/regexpp": "^4.10.0", | ||
"@typescript-eslint/scope-manager": "8.5.1-alpha.5", | ||
"@typescript-eslint/type-utils": "8.5.1-alpha.5", | ||
"@typescript-eslint/utils": "8.5.1-alpha.5", | ||
"@typescript-eslint/visitor-keys": "8.5.1-alpha.5", | ||
"@typescript-eslint/scope-manager": "8.5.1-alpha.6", | ||
"@typescript-eslint/type-utils": "8.5.1-alpha.6", | ||
"@typescript-eslint/utils": "8.5.1-alpha.6", | ||
"@typescript-eslint/visitor-keys": "8.5.1-alpha.6", | ||
"graphemer": "^1.4.0", | ||
@@ -78,4 +78,4 @@ "ignore": "^5.3.1", | ||
"@types/natural-compare": "*", | ||
"@typescript-eslint/rule-schema-to-typescript-types": "8.5.1-alpha.5", | ||
"@typescript-eslint/rule-tester": "8.5.1-alpha.5", | ||
"@typescript-eslint/rule-schema-to-typescript-types": "8.5.1-alpha.6", | ||
"@typescript-eslint/rule-tester": "8.5.1-alpha.6", | ||
"ajv": "^6.12.6", | ||
@@ -82,0 +82,0 @@ "cross-env": "^7.0.3", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2624808
29961
+ Added@typescript-eslint/scope-manager@8.5.1-alpha.6(transitive)
+ Added@typescript-eslint/type-utils@8.5.1-alpha.6(transitive)
+ Added@typescript-eslint/types@8.5.1-alpha.6(transitive)
+ Added@typescript-eslint/typescript-estree@8.5.1-alpha.6(transitive)
+ Added@typescript-eslint/utils@8.5.1-alpha.6(transitive)
+ Added@typescript-eslint/visitor-keys@8.5.1-alpha.6(transitive)
- Removed@typescript-eslint/scope-manager@8.5.1-alpha.5(transitive)
- Removed@typescript-eslint/type-utils@8.5.1-alpha.5(transitive)
- Removed@typescript-eslint/types@8.5.1-alpha.5(transitive)
- Removed@typescript-eslint/typescript-estree@8.5.1-alpha.5(transitive)
- Removed@typescript-eslint/utils@8.5.1-alpha.5(transitive)
- Removed@typescript-eslint/visitor-keys@8.5.1-alpha.5(transitive)