Skip to content
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

no-for-loop: Respect declaration kind #878

Merged
merged 5 commits into from Oct 20, 2020

Conversation

fisker
Copy link
Collaborator

@fisker fisker commented Oct 20, 2020

Fixes #742

Comment on lines +739 to +743
output: outdent`
for (let [i, last]: [number, vscode.Position | vscode.Range] of positions.entries()) {
let selectionRange = allProviderRanges[i];
}
`,
Copy link
Collaborator Author

@fisker fisker Oct 20, 2020

Choose a reason for hiding this comment

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

The old code fix this to

				for (let [i, last: vscode.Position | vscode.Range] of positions.entries()) {
					let selectionRange = allProviderRanges[i];
				}

This cause parser error.

I don't use typescript, is this new output good?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, that looks correct.

@sindresorhus sindresorhus merged commit df3f7bd into sindresorhus:master Oct 20, 2020
@fisker fisker deleted the no-for-loop-declaration branch October 20, 2020 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no-for-loop produces invalid autofix when mutation is present
2 participants