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 (348 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>
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:
As for remaining nodes, here is their state:
AccessorProperty - skipped (class is already reported)
ArrayExpression - valid
ArrayPattern - skipped (already reported by VariableDeclarator)
ArrowFunctionExpression - TODO
AssignmentExpression - valid
AssignmentPattern - reported
AwaitExpression - reported
BinaryExpression - valid
BlockStatement - valid
BreakStatement - valid
CallExpression - valid
CatchClause - skipped (try is already reported)
ChainExpression - skipped (we don't support it but we should, I think)
ClassBody - skipped (class is already reported)
ClassDeclaration - reported
ClassExpression - reported
ConditionalExpression - valid
ContinueStatement - valid
DebuggerStatement - skipped (come on)
Decorator - skipped (come on)
DoWhileStatement - reported
EmptyStatement - skipped (come on)
ForInStatement - reported
ForOfStatement - valid
ForStatement - valid
FunctionDeclaration - TODO
FunctionExpression - TODO
Identifier - valid
IfStatement - valid
LabeledStatement - skipped (come on)
Literal - valid
LogicalExpression - valid
MemberExpression - valid
MethodDefinition - skipped (class is already reported)
NewExpression - reported
ObjectExpression - valid
ObjectPattern - skipped (already reported by VariableDeclarator)
PrivateIdentifier - reported
Program - skipped (unreachable)
Property - only reported if it's method or computed
PropertyDefinition - skipped (class is already reported)
RestElement - skipped (functions will be reported)
ReturnStatement - valid
SequenceExpression - reported
SpreadElement - reported
StaticBlock - skipped (come on)
Super - skipped (come on)
SwitchCase - skipped (switch is already reported)
SwitchStatement - reported
TaggedTemplateExpression - skipped (tagged template literal is already reported)
TemplateElement - skipped (tagged template is already reported)
TemplateLiteral - reported
ThisExpression - valid
ThrowStatement - reported
TryStatement - reported
UnaryExpression - valid
UpdateExpression - only reported if prefix
VariableDeclaration - only reported if declares multiple variables
VariableDeclarator - only reported if uses variable destructuring (
const [a] = ...,const { a } = ...)WhileStatement - valid
WithStatement - skipped (come on)
YieldExpression - reported