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

[Fix] consistent-type-specifier-style: fix accidental removal of comma in certain cases #2754

merged 1 commit into from Apr 6, 2023


Copy link

Fixes #2753

When passed the second argument - getTokenAfter will keep searching until it finds a token that matches that token - so in this bug it meant it kept scanning to the next import declaration.
Using the single-arg form means it will just grab the next token and we can then check to see if that token is a comma or not (it'll either be a } or a ,).

Copy link

Ah, that would probably explain a couple other weird things I saw that i thought were just me being clumsy with multi-line editing, e.g. a missing comma between type variables.

Thanks for looking into this!

Copy link

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

Thank you!

@ljharb ljharb force-pushed the 2753-remove-extra-comma-oops branch from 3ef4222 to 6f12316 Compare April 6, 2023 17:40
@ljharb ljharb changed the title [Fix] : fix accidental removal of comma in certain cases [Fix] consistent-type-specifier-style: fix accidental removal of comma in certain cases Apr 6, 2023
@ljharb ljharb merged commit 6f12316 into import-js:main Apr 6, 2023
150 of 151 checks passed
Copy link

Is there any plan for when this there will be a new point release on NPM that includes this fix? It's been merged for a while now, is there anything blocking a release?

@bradzacher bradzacher deleted the 2753-remove-extra-comma-oops branch May 15, 2023 13:41
Copy link

ljharb commented May 15, 2023

@mathiasose there's no concrete plan, just "in the next release"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

[consistent-type-specifier-style] Fixer breaks adjacent code (syntax error due to missing comma)
4 participants