mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Apply 'prefer-for-of' tslint rule (#19721)
This commit is contained in:
@@ -20,8 +20,8 @@ namespace ts.codefix {
|
||||
// i.e. super(this.a), since in that case we won't suggest a fix
|
||||
if (superCall.expression && superCall.expression.kind === SyntaxKind.CallExpression) {
|
||||
const expressionArguments = (<CallExpression>superCall.expression).arguments;
|
||||
for (let i = 0; i < expressionArguments.length; i++) {
|
||||
if ((<PropertyAccessExpression>expressionArguments[i]).expression === token) {
|
||||
for (const arg of expressionArguments) {
|
||||
if ((<PropertyAccessExpression>arg).expression === token) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,8 +104,7 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
const signatureDeclarations: MethodDeclaration[] = [];
|
||||
for (let i = 0; i < signatures.length; i++) {
|
||||
const signature = signatures[i];
|
||||
for (const signature of signatures) {
|
||||
const methodDeclaration = signatureToMethodDeclaration(signature, enclosingDeclaration);
|
||||
if (methodDeclaration) {
|
||||
signatureDeclarations.push(methodDeclaration);
|
||||
@@ -194,8 +193,7 @@ namespace ts.codefix {
|
||||
let maxArgsSignature = signatures[0];
|
||||
let minArgumentCount = signatures[0].minArgumentCount;
|
||||
let someSigHasRestParameter = false;
|
||||
for (let i = 0; i < signatures.length; i++) {
|
||||
const sig = signatures[i];
|
||||
for (const sig of signatures) {
|
||||
minArgumentCount = Math.min(sig.minArgumentCount, minArgumentCount);
|
||||
if (sig.hasRestParameter) {
|
||||
someSigHasRestParameter = true;
|
||||
|
||||
Reference in New Issue
Block a user