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 internal ESLint plugin consumed by the repo’s oxlint configuration to enforce import-path hygiene (simplifying redundant relative paths and preventing overly-deep relative imports in docs examples), and applies path simplifications across the TypeGPU package.
Changes:
- Introduces
packages/eslint-plugin-internalwith two rules:no-useless-path-segmentsandno-long-imports, plus Vitest-based rule tests. - Wires the new plugin + rules into
oxlint.config.tsand workspace dependencies. - Simplifies several TypeGPU internal imports by removing redundant path segments.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds the new workspace plugin and updates lock entries accordingly. |
| package.json | Adds eslint-plugin-internal as a workspace dev dependency. |
| oxlint.config.ts | Loads eslint-plugin-internal and enables the new rules (glob-scoped for examples). |
| packages/typegpu/src/tgsl/generationHelpers.ts | Simplifies internal imports to shorter relative paths. |
| packages/typegpu/src/core/unroll/tgpuUnroll.ts | Simplifies internal imports to shorter relative paths. |
| packages/typegpu/src/core/slot/slotTypes.ts | Fixes redundant/odd relative import segment (./../). |
| packages/typegpu/src/core/root/rootTypes.ts | Simplifies imports for querySet and tgpuComputeFn. |
| packages/typegpu/src/core/root/init.ts | Simplifies querySet imports. |
| packages/typegpu/src/core/querySet/querySet.ts | Simplifies root types import. |
| packages/typegpu/src/core/pipeline/renderPipeline.ts | Simplifies buffer/querySet imports. |
| packages/typegpu/src/core/pipeline/computePipeline.ts | Simplifies querySet import. |
| packages/eslint-plugin-internal/* | New internal lint plugin package, rules, tests, and build/test configs. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/eslint-plugin-internal/tests/rules/noUselessPathSegments.test.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin-internal/tests/rules/noLongImports.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR introduces a new internal lint plugin, along with two rules.
Rule
noUselessPathSegments- mirrors eslint-plugin-import rule that is not yet implemented in oxlint, it looks for unnecessary import segments like../../src/file.txt->../file.txt.Rule
noLongImports- forbids imports starting with../..in examples (except../../common), since they are most likely an import mishap likeimport { vec2f } from '../../../../../../packages/typegpu/src/data/vector.ts';that won't work on stackblitz anyway.I tried to test it on our windows PCs in the office, but I had so many issues with spaces in username that I gave up.