mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 11:31:11 -05:00
@@ -15832,12 +15832,12 @@ namespace ts {
|
||||
for (const key in node.locals) {
|
||||
const local = node.locals[key];
|
||||
if (!local.isReferenced) {
|
||||
if (local.valueDeclaration && local.valueDeclaration.kind === SyntaxKind.Parameter) {
|
||||
const parameter = <ParameterDeclaration>local.valueDeclaration;
|
||||
if (local.valueDeclaration && getRootDeclaration(local.valueDeclaration).kind === SyntaxKind.Parameter) {
|
||||
const parameter = <ParameterDeclaration>getRootDeclaration(local.valueDeclaration);
|
||||
if (compilerOptions.noUnusedParameters &&
|
||||
!isParameterPropertyDeclaration(parameter) &&
|
||||
!parameterIsThisKeyword(parameter) &&
|
||||
!parameterNameStartsWithUnderscore(parameter)) {
|
||||
!parameterNameStartsWithUnderscore(local.valueDeclaration.name)) {
|
||||
error(local.valueDeclaration.name, Diagnostics._0_is_declared_but_never_used, local.name);
|
||||
}
|
||||
}
|
||||
@@ -15861,8 +15861,8 @@ namespace ts {
|
||||
error(node, Diagnostics._0_is_declared_but_never_used, name);
|
||||
}
|
||||
|
||||
function parameterNameStartsWithUnderscore(parameter: ParameterDeclaration) {
|
||||
return parameter.name && isIdentifierThatStartsWithUnderScore(parameter.name);
|
||||
function parameterNameStartsWithUnderscore(parameterName: DeclarationName) {
|
||||
return parameterName && isIdentifierThatStartsWithUnderScore(parameterName);
|
||||
}
|
||||
|
||||
function isIdentifierThatStartsWithUnderScore(node: Node) {
|
||||
|
||||
Reference in New Issue
Block a user