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

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

Closed
aaronadamsCA opened this issue Apr 5, 2023 · 4 comments · Fixed by #2754

Comments

@aaronadamsCA
Copy link
Contributor

Input:

import { Component, type ComponentProps } from "package-1";
import {
  Component1,
  Component2,
  Component3,
  Component4,
  Component5,
} from "package-2";

Actual output (syntax error):

import { Component  } from "package-1";
import type {ComponentProps} from "package-1";
import {
  Component1
  Component2,
  Component3,
  Component4,
  Component5,
} from "package-2";

Expected output:

 import { Component  } from "package-1";
 import type {ComponentProps} from "package-1";
 import {
-  Component1
+  Component1,
   Component2,
   Component3,
   Component4,
@ljharb
Copy link
Member

ljharb commented Apr 5, 2023

cc @bradzacher

@bradzacher
Copy link
Contributor

I'd have to test and investigate properly, but at least based on the description I don't think this is due to the consistent-type-specifier-style rule because the fixer should only touch relevant imports.

@ljharb
Copy link
Member

ljharb commented Apr 6, 2023

@aaronadamsCA can you confirm that this happens with only that rule enabled?

@bradzacher
Copy link
Contributor

Huh - nope, I can confirm this is the output testing against main. SUPER WEIRD.

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