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(analyzer): script block detection in vue and svelte files #2457

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

Sec-ant
Copy link
Member

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

Summary

Fix the regexes we use for script block detection in .vue and .svelte files to support generic components in .vue files.

Closes #2456.

Test Plan

Added a test case borrowed from #2456.

@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Website Area: website A-Changelog Area: changelog labels Apr 15, 2024
Copy link

netlify bot commented Apr 15, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 0626e0b
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/661d01e43b44e60009835c05
😎 Deploy Preview https://deploy-preview-2457--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: 100 (no change 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.

@Sec-ant Sec-ant force-pushed the fix/vue-svelte-regex branch from 3f08282 to a59556e Compare April 15, 2024 10:24
@Sec-ant Sec-ant force-pushed the fix/vue-svelte-regex branch from a59556e to 9eea0a6 Compare April 15, 2024 10:26
@Conaclos Conaclos merged commit 05e4796 into biomejs:main Apr 15, 2024
15 checks passed
@Sec-ant Sec-ant deleted the fix/vue-svelte-regex branch April 15, 2024 11:58
@nhedger
Copy link
Member

nhedger commented Apr 15, 2024

Some of the unit tests (in regex101) are failing: https://regex101.com/r/E4n4hh/6 (see Unit Tests section), not sure what the impact is.

Edit: seems to have been the case in previous versions too, may it's just outdated.

@Sec-ant
Copy link
Member Author

Sec-ant commented Apr 15, 2024

Some of the unit tests (in regex101) are failing: https://regex101.com/r/E4n4hh/6 (see Unit Tests section), not sure what the impact is.

Thank you for pointing that out! I didn't even know that there're unit tests in regex101. But I think those are false alarms because I've changed the capture groups and we're now using the JSX parser for the attributes instead of using regex capture groups. So I think we're fine here.

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.

🐛 parse error when using generic component in vue files
3 participants