Conversation
- Detect unguarded browser globals in top-level Vue and Svelte scripts - Add configuration, diagnostics, fixtures, snapshots, and changeset
🦋 Changeset detectedLatest commit: 04f1af2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: ⛔ Files ignored due to path filters (26)
📒 Files selected for processing (26)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughAdds the Merge Risk: ⚪ Minimal · up to The new rule, options export, and fixtures have no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
ematipico
left a comment
There was a problem hiding this comment.
IMHO, as it is, the rule is a bit limited. I believe we can make it more powerful if we make it a project rule, and we inspect the also the modules imported by a component.
The moment you move the unguarded global into a simple file, and import it inside the component, the rule cease to function
| use biome_rule_options::no_top_level_browser_globals::NoTopLevelBrowserGlobalsOptions; | ||
|
|
||
| declare_lint_rule! { | ||
| /// Disallow unguarded browser globals at the top level of Vue and Svelte scripts. |
Summary
this pr adds noTopLevelBrowserGlobals, a cross framework rule intended to protect projects that use server side rendering.
inspired by (and pretty much an expanded scope port of) https://sveltejs.github.io/eslint-plugin-svelte/rules/no-top-level-browser-globals/
implemented by astra
Test Plan
snapshots
Docs