Repository navigation
chore: lint with oxlint - #1359
Merged
Merged
Conversation
Agent skills are installed from skills-lock.json, while the installed copies in .agents and .claude stay out of git, as in the other Trigen repositories. AGENTS.md describes what matters in this repository; CLAUDE.md points to it.
pnpm 12 reads build script approvals from allowBuilds instead of onlyBuiltDependencies.
Every job takes Node.js from .tool-versions and pnpm 12, actions are pinned to release commits, which renovate keeps current, and the token of a run only reads unless a job needs more. Tests run as separate types, lint and unit jobs; checks add package.json linting; commitlint runs from the repository; the release job is ready for npm trusted publishing.
The big-lib preset runs the bundle in headless Chrome, which no longer works; the small-lib preset measures what a consumer ships, for the whole package and for single components, with limits pinned on a 50 B step.
The description ends with a period and the homepage, now the documentation website, follows the license.
The react-chartjs-2 tag on Stack Overflow gets no new questions since 2025. The bug report now points to the StackBlitz sandbox.
Vite builds the same ESM and CommonJS entries that rollup with swc did, unminified and for modern targets, so the pure annotations reach the bundlers of consumers. Declarations are emitted from tsconfig.build.json, and the scripts follow the Trigen baseline.
Specs live beside the code they test, and tsd type tests become @ts-expect-error cases in them, checked by tsc and by Vitest typecheck.
Addons that moved into the core are dropped, the config is ESM TypeScript, and the scripts are named as in the other Trigen repositories: storybook and storybook:build. chartjs-plugin-zoom 3 ships ESM types that the stories need.
Stories are type-checked with the rest of the code now, so a change of the component types that breaks a usage shows up in test:types.
Claude Code reads AGENTS.md by itself.
The sandboxes were a separate pnpm workspace with their own lockfile, so they got another copy of Chart.js and ran on the package from npm. In the root workspace they share one install and run on the sources of the package; StackBlitz still installs each one with its own package.json from npm.
The sandboxes resolve the package to its sources through the workspace now.
ESLint with the standard config and Prettier are replaced by oxlint with @trigen/oxlint-config: base, module, React, type-checked TypeScript, test and Storybook configs, with type-aware rules and type checking on. oxlint --fix also formats, so Prettier is gone. Sample data in sandboxes and stories may use plain numbers and log to the console.
MutableRefObject is deprecated in React 19 types. RefObject<T | null> accepts the same refs: useRef(null) results with any @types/react version from the peer range.
The code follows the Trigen style now. Besides formatting: props of elements are ordered, helpers that capture nothing move to the module scope, and stories import types first.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1359 +/- ##
==========================================
+ Coverage 93.75% 93.97% +0.22%
==========================================
Files 3 3
Lines 80 83 +3
Branches 20 20
==========================================
+ Hits 75 78 +3
Misses 3 3
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 30, 2026
Stories import the sandboxes, which import react-chartjs-2 by name: without an install of the sandboxes, as in CI, tsc maps the name to the sources.
The sandboxes resolve the package to its sources through the workspace now.
This was referenced Nov 30, 2026
The sandboxes resolve the package to its sources through the workspace now.
Questions go to the Q&A category of Discussions instead of issues, so they stay apart from bug reports and an answer can be marked.
Questions go to the Q&A category of Discussions instead of issues, so they stay apart from bug reports and an answer can be marked.
The specs checked only the props types, so the render function of the typed components was never run.
# Conflicts: # src/typedCharts.spec.tsx
With empty datasets Chart.js never looks up the controller, so the tests passed even without the controller registration. Each test now checks one behavior.
# Conflicts: # src/typedCharts.spec.tsx
dangreen
marked this pull request as ready for review
November 30, 2026 15:48
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 6 of the tooling stack. Based on master (#1354–#1358 are merged).
What
eslint-to-oxlintskill).oxlint.config.tswraps@trigen/oxlint-configindefineConfigfrom@trigen/oxlintand extends the base, module, React, type-checked TypeScript, test and Storybook configs, withtypeAwareandtypeCheckon (oxlint-tsgolint).oxlint --fixalso formats, so Prettier and its config are gone.lint→oxlint,format→oxlint --fix;.nano-staged.jsonrunsoxlint --fixon staged files.sandboxesandstoriesmay use plain numbers and log to the console (one override).fix::ForwardedRefusesRefObject<T | null>instead ofMutableRefObject<T | null>, which is deprecated in React 19 types. It accepts the same refs from every@types/reactversion in the peer range.oxlint-disable-next-line typescript/no-misused-spreadinchart.tsx, whereoptionsis shallow-copied so Chart.js does not mutate the user's object (the rule mistakes the options type for a class instance).Left as is
Four
react-hooks/exhaustive-depswarnings inchart.tsxthat ESLint reported too: adding the dependencies would change when the chart is re-created.Checked locally
pnpm test(lint, unit, types),pnpm build(sizes unchanged: 857 / 538 / 590 B),pnpm storybook:build,pnpm sandboxes:build; noeslint/prettierconfig or dependency left (only the two/* eslint-disable */in Docusaurus files, which the website PR deletes).Merging
GitHub could not rebase this branch after the lower PRs were squash-merged, so master is merged into it instead (the trees were identical, so the merge changes nothing). Its commit list therefore also shows the commits of #1354–#1358. When squash-merging, keep only this PR's own commits in the message:
chore: lint with oxlint,fix: type ref objects with RefObjectandstyle: format the code with oxlint.Stack
🤖 Generated with Claude Code