Skip to content

fix(file_handler): svelte & vue script language parsing#2317

Merged
Sec-ant merged 2 commits into
biomejs:mainfrom
Sec-ant:fix/svelte-vue-language-parsing
Apr 5, 2024
Merged

fix(file_handler): svelte & vue script language parsing#2317
Sec-ant merged 2 commits into
biomejs:mainfrom
Sec-ant:fix/svelte-vue-language-parsing

Conversation

@Sec-ant

@Sec-ant Sec-ant commented Apr 5, 2024

Copy link
Copy Markdown
Contributor

Summary

Use the JSX flavor JavaScript parser to parse the opening tags of the script blocks in Svelte and Vue files so we can parse the language of the script in them more reliably.

Closes #2245.

Test Plan

Test cases are added.

@Sec-ant Sec-ant requested a review from ematipico April 5, 2024 08:59
@github-actions github-actions Bot added A-CLI Area: CLI A-Project Area: project A-Website Area: website A-Changelog Area: changelog labels Apr 5, 2024
@netlify

netlify Bot commented Apr 5, 2024

Copy link
Copy Markdown

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 0d031ba
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/660fdec479ea860008f69e17
😎 Deploy Preview https://deploy-preview-2317--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@ematipico ematipico left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I must admit, that was a very clever solution :)

/// We use the JSX parser at the moment to parse the opening tag. So the opening tag should be first
/// matched by regular expressions.
///
/// TODO: We should change the parser when HTMLish languages are supported.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/// TODO: We should change the parser when HTMLish languages are supported.
// TODO: We should change the parser when HTMLish languages are supported.

The TODO shouldn't be a doc comment

@Sec-ant Sec-ant merged commit db5a1e9 into biomejs:main Apr 5, 2024
@Sec-ant Sec-ant deleted the fix/svelte-vue-language-parsing branch April 5, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Changelog Area: changelog A-CLI Area: CLI A-Project Area: project A-Website Area: website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 In Svelte context=module Scripts error "import { type x ident }' are a TypeScript only feature."

2 participants