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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(postcss-syntax): throw error when parsing TS #553

Merged
merged 4 commits into from
May 10, 2024

Conversation

YuanboXue-Amber
Copy link
Contributor

When using @griffel/postcss-syntax parse on TS code:

parse(`import type { Something } from 'somwhere'`, {
  babelOptions: {
    presets: ["@babel/preset-typescript"],
  },
});

It throws error 馃挜 Unexpected token, expected "from".

This happens because presets config is not used when transforming code with Babel.

This PR takes the babelOptions presets/plugins and use it during transform.

@YuanboXue-Amber YuanboXue-Amber marked this pull request as ready for review May 9, 2024 12:22
@YuanboXue-Amber YuanboXue-Amber requested a review from a team as a code owner May 9, 2024 12:22
Copy link

github-actions bot commented May 9, 2024

馃搳 Bundle size report

馃 This report was generated against b1ab99887757fd6cf2eb66abf203c3eef93abd9d

@YuanboXue-Amber YuanboXue-Amber merged commit 1767ae3 into microsoft:main May 10, 2024
4 checks passed
@YuanboXue-Amber YuanboXue-Amber deleted the fix-ts branch May 10, 2024 10:09
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.

None yet

2 participants