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

Add convert const to let #33157

Merged
merged 3 commits into from
Sep 17, 2019
Merged

Add convert const to let #33157

merged 3 commits into from
Sep 17, 2019

Conversation

fuafa
Copy link
Contributor

@fuafa fuafa commented Aug 30, 2019

Fixes #22473

@orta orta added the Update Docs on Next Release Indicates that this PR affects docs label Sep 11, 2019
@orta orta self-assigned this Sep 11, 2019
@orta
Copy link
Contributor

orta commented Sep 11, 2019

Hi @fuafa thanks for the PR - perfect. After reading the original issue there was a mention about:

Also you will need to add handling for the readonly property case, where the readonly modifier would be removed.

But we don't need to handle that because that's now a separate diagnostic error (and so this fixit won't be included)

errorCodes,
getCodeActions: context => {
const { sourceFile, span, program } = context;
const variableStatement = getVaribleStatement(sourceFile, span.start, program);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const variableStatement = getVaribleStatement(sourceFile, span.start, program);
const variableStatement = getVariableStatement(sourceFile, span.start, program);

fixIds: [fixId]
});

function getVaribleStatement(sourceFile: SourceFile, pos: number, program: Program) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function getVaribleStatement(sourceFile: SourceFile, pos: number, program: Program) {
function getVariableStatement(sourceFile: SourceFile, pos: number, program: Program) {

@fuafa
Copy link
Contributor Author

fuafa commented Sep 17, 2019

Thanks @orta, sorry for the late response, typo fixed.

@orta
Copy link
Contributor

orta commented Sep 17, 2019

Looks good, thanks 👍

@orta orta merged commit bf46ded into microsoft:master Sep 17, 2019
@fuafa fuafa deleted the convert-const-to-let branch October 1, 2019 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Update Docs on Next Release Indicates that this PR affects docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codefix: convert const to let
2 participants