Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (349 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
There was a problem hiding this comment.
Pull request overview
Adds a new typegpu/no-unsupported-syntax ESLint rule to flag JavaScript constructs that can’t be translated into valid WGSL inside 'use gpu' functions, and wires it into the plugin’s shipped configs.
Changes:
- Introduce
no-unsupported-syntaxrule with targeted reports for a set of unsupported ESTree node types when inside'use gpu'. - Add a comprehensive RuleTester suite for the new rule.
- Register the rule in
recommendedandallconfigs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/eslint-plugin/src/rules/noUnsupportedSyntax.ts | New rule implementation using directiveTracking to conditionally report unsupported syntax inside 'use gpu'. |
| packages/eslint-plugin/tests/noUnsupportedSyntax.test.ts | New unit tests covering valid/invalid syntax cases and expected diagnostics. |
| packages/eslint-plugin/src/configs.ts | Registers the new rule and enables it in recommended (warn) and all (error). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
== |
There was a problem hiding this comment.
Pull request overview
Adds a new ESLint rule to help TypeGPU users avoid JavaScript syntax that can’t be reliably translated into WGSL, integrating it into the plugin’s configs and documentation.
Changes:
- Introduce
typegpu/no-unsupported-syntaxrule that reports various unsupported/conditionally-supported AST node types inside'use gpu'functions. - Extend the
directiveTrackingenhancer API to expose the current directive stack for nested-function detection. - Add comprehensive rule tests and user-facing documentation, and wire the rule into
recommended/allconfigs + README rule list.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/eslint-plugin/src/rules/noUnsupportedSyntax.ts | New rule implementation using directive tracking to scope reports to TypeGPU functions (and nested functions within them). |
| packages/eslint-plugin/src/enhancers/directiveTracking.ts | Exposes directive stack to consumers (used for nested-function detection). |
| packages/eslint-plugin/tests/rules/noUnsupportedSyntax.test.ts | New RuleTester suite covering valid/invalid syntax cases. |
| packages/eslint-plugin/src/configs.ts | Registers the new rule and enables it in recommended (warn) and all (error). |
| packages/eslint-plugin/README.md | Adds the new rule to the auto-generated rules list table. |
| packages/eslint-plugin/docs/rules/no-unsupported-syntax.md | New documentation page with examples and config note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Blocked by #2235 since both PRs need to update directive tracking enhancer.I tried to be thorough because this may be beneficial for agents writing typegpu functions.
I went through all possible node types, here is the current state of things.
Valid:
Reported:
Conditionally reported:
==or other unsupported)??)var)const [a] = ...,const { a } = ...)Skipped because there is no need to report:
Skipped because I don't think we care: