mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Fixed bug that resulted in diagnostics associated with the reportUnnecessaryTypeIgnoreComment
check to not include the error code. This addresses #7883.
This commit is contained in:
parent
496e50f65c
commit
e654729d96
@ -1072,9 +1072,9 @@ export class SourceFile {
|
||||
const range = convertOffsetsToRange(rangeStart, rangeEnd, this._writableData.tokenizerLines!);
|
||||
|
||||
if (!isUnreachableCodeRange(range) && this._diagnosticRuleSet.enableTypeIgnoreComments) {
|
||||
unnecessaryTypeIgnoreDiags.push(
|
||||
new Diagnostic(diagCategory, LocMessage.unnecessaryTypeIgnore(), range)
|
||||
);
|
||||
const diag = new Diagnostic(diagCategory, LocMessage.unnecessaryTypeIgnore(), range);
|
||||
diag.setRule(DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
||||
unnecessaryTypeIgnoreDiags.push(diag);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1085,9 +1085,9 @@ export class SourceFile {
|
||||
const range = convertOffsetsToRange(rangeStart, rangeEnd, this._writableData.tokenizerLines!);
|
||||
|
||||
if (!isUnreachableCodeRange(range) && this._diagnosticRuleSet.enableTypeIgnoreComments) {
|
||||
unnecessaryTypeIgnoreDiags.push(
|
||||
new Diagnostic(diagCategory, LocMessage.unnecessaryTypeIgnore(), range)
|
||||
);
|
||||
const diag = new Diagnostic(diagCategory, LocMessage.unnecessaryTypeIgnore(), range);
|
||||
diag.setRule(DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
||||
unnecessaryTypeIgnoreDiags.push(diag);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -1100,9 +1100,9 @@ export class SourceFile {
|
||||
const range = convertOffsetsToRange(rangeStart, rangeEnd, this._writableData.tokenizerLines!);
|
||||
|
||||
if (!isUnreachableCodeRange(range)) {
|
||||
unnecessaryTypeIgnoreDiags.push(
|
||||
new Diagnostic(diagCategory, LocMessage.unnecessaryPyrightIgnore(), range)
|
||||
);
|
||||
const diag = new Diagnostic(diagCategory, LocMessage.unnecessaryTypeIgnore(), range);
|
||||
diag.setRule(DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
||||
unnecessaryTypeIgnoreDiags.push(diag);
|
||||
}
|
||||
} else {
|
||||
ignoreComment.rulesList.forEach((unusedRule) => {
|
||||
@ -1115,15 +1115,15 @@ export class SourceFile {
|
||||
);
|
||||
|
||||
if (!isUnreachableCodeRange(range)) {
|
||||
unnecessaryTypeIgnoreDiags.push(
|
||||
new Diagnostic(
|
||||
diagCategory,
|
||||
LocMessage.unnecessaryPyrightIgnoreRule().format({
|
||||
name: unusedRule.text,
|
||||
}),
|
||||
range
|
||||
)
|
||||
const diag = new Diagnostic(
|
||||
diagCategory,
|
||||
LocMessage.unnecessaryPyrightIgnoreRule().format({
|
||||
name: unusedRule.text,
|
||||
}),
|
||||
range
|
||||
);
|
||||
diag.setRule(DiagnosticRule.reportUnnecessaryTypeIgnoreComment);
|
||||
unnecessaryTypeIgnoreDiags.push(diag);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user