Skip to content

When applying // @ts-ignore fix as a group, apply to a line only once. #21413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from
Jan 25, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jan 25, 2018

Fixes #21378

@@ -35,15 +35,21 @@ namespace ts.codefix {
fixId: undefined,
}];
},
fixIds: [fixId], // No point applying as a group, doing it once will fix all errors
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is better written a few lines up -- no point applying the // @ts-nocheck fix as a group. There is a point applying // @ts-ignore as a group.

@ghost ghost requested a review from amcasey January 25, 2018 19:18
});

function getIgnoreCommentLocationForLocation(sourceFile: SourceFile, position: number, newLineCharacter: string): TextChange {
function getIgnoreCommentLocationForLocation(sourceFile: SourceFile, position: number, newLineCharacter: string): { line: number, change: TextChange } {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there's an existing convention, I would be tempted to rename "line" to "lineNumber". At the call site, I couldn't figure out whether it was the line text or the line number. (Yes, I realize that using the line text would make no sense.)

@ghost ghost merged commit 7c4e755 into master Jan 25, 2018
@ghost ghost deleted the codeFixDisable branch January 25, 2018 21:53
@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant