Repository navigation
Commit fe7d82c
authored
chore: lint with oxlint (#1359)
* chore: add agent skills lock and agent notes
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.
* chore: update Node.js to 26 and pnpm to 12
pnpm 12 reads build script approvals from allowBuilds instead of onlyBuiltDependencies.
* ci: align workflows with the Trigen baseline
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.
* chore: measure size with the small-lib preset
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.
* chore: fix package.json lint errors
The description ends with a period and the homepage, now the documentation website, follows the license.
* chore: replace the Stack Overflow link with a question template
The react-chartjs-2 tag on Stack Overflow gets no new questions since 2025. The bug report now points to the StackBlitz sandbox.
* build: build the package with Vite
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.
* test: move tests next to the sources and check types with tsc
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.
* chore: update Storybook to 10
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.
* chore: write stories in typed CSF3
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.
* chore: remove CLAUDE.md
Claude Code reads AGENTS.md by itself.
* chore: install the sandboxes from the root workspace
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.
* chore: drop the Storybook alias to the sources
The sandboxes resolve the package to its sources through the workspace now.
* chore: lint with oxlint
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.
* fix: type ref objects with RefObject
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.
* style: format the code with oxlint
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.
* chore: resolve the package to its sources in type checks
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.
* chore: drop the path mapping to the sources
The sandboxes resolve the package to its sources through the workspace now.
* chore: add funding links
npm fund and the Sponsor button of the repository point to Ko-fi, as in the other repositories of the maintainer.
* fix: keep the pure annotations of forwardRef calls
swc added them to the build, Vite does not: without them a bundler keeps Chart and its Chart.js core even when only an event helper is imported. The annotations are in the sources now, and size-limit measures a helper-only import. The type test of plugins on the generic Chart, lost in the move from tsd, is back.
* chore: update Node.js to 26 and pnpm to 12
pnpm 12 reads build script approvals from allowBuilds instead of onlyBuiltDependencies.
* ci: align workflows with the Trigen baseline
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.
* chore: measure size with the small-lib preset
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.
* chore: fix package.json lint errors
The description ends with a period and the homepage, now the documentation website, follows the license.
* build: build the package with Vite
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.
* chore: replace the Stack Overflow link with a question template
The react-chartjs-2 tag on Stack Overflow gets no new questions since 2025. The bug report now points to the StackBlitz sandbox.
* test: move tests next to the sources and check types with tsc
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.
* chore: add funding links
npm fund and the Sponsor button of the repository point to Ko-fi, as in the other repositories of the maintainer.
* fix: keep the pure annotations of forwardRef calls
swc added them to the build, Vite does not: without them a bundler keeps Chart and its Chart.js core even when only an event helper is imported. The annotations are in the sources now, and size-limit measures a helper-only import. The type test of plugins on the generic Chart, lost in the move from tsd, is back.
* chore: update Storybook to 10
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.
* chore: install the sandboxes from the root workspace
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.
* chore: write stories in typed CSF3
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.
* chore: drop the Storybook alias to the sources
The sandboxes resolve the package to its sources through the workspace now.
* chore: resolve the package to its sources in type checks
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.
* chore: drop the path mapping to the sources
The sandboxes resolve the package to its sources through the workspace now.
* chore: send questions to GitHub Discussions
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.
* chore: send questions to GitHub Discussions
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.
* test: render the typed chart components
The specs checked only the props types, so the render function of the typed components was never run.
* test: check the controller, ref and options of the typed charts
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.1 parent cfc7317 commit fe7d82c
81 files changed
Lines changed: 2753 additions & 3460 deletions
File tree
- .storybook
- sandboxes
- bar
- grouped
- horizontal
- stacked
- vertical
- bubble/default
- chart
- canvas
- events
- multitype
- ref
- doughnut/default
- line
- area
- default
- multiaxis
- pie/default
- polarArea/default
- radar/default
- scatter/default
- src
- stories
- test
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
82 | | - | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | 93 | | |
103 | 94 | | |
104 | 95 | | |
105 | | - | |
| 96 | + | |
| 97 | + | |
106 | 98 | | |
107 | 99 | | |
108 | 100 | | |
| |||
0 commit comments