Skip to content

Commit 162120d

Browse files
committed
build: upgrade
1 parent 095bbbc commit 162120d

13 files changed

+1461
-5965
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 25 deletions
This file was deleted.

.yarn/releases/yarn-4.4.1.cjs renamed to .yarn/releases/yarn-4.5.0.cjs

Lines changed: 162 additions & 162 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
packageExtensions:
2-
eslint-module-utils@*:
3-
dependencies:
4-
eslint-import-resolver-node: "*"
5-
6-
yarnPath: .yarn/releases/yarn-4.4.1.cjs
1+
yarnPath: .yarn/releases/yarn-4.5.0.cjs

eslint.config.mjs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
import prettier from 'eslint-plugin-prettier';
6+
7+
export default tseslint.config(eslint.configs.recommended, ...tseslint.configs.recommended, {
8+
plugins: { prettier },
9+
rules: {
10+
'@typescript-eslint/no-explicit-any': 'off',
11+
'max-classes-per-file': 'off',
12+
'no-underscore-dangle': 'off',
13+
'import/extensions': 'off',
14+
},
15+
});
16+
17+
// import path from "node:path";
18+
// import { fileURLToPath } from "node:url";
19+
// import js from "@eslint/js";
20+
// import { FlatCompat } from "@eslint/eslintrc";
21+
22+
// const __filename = fileURLToPath(import.meta.url);
23+
// const __dirname = path.dirname(__filename);
24+
// const compat = new FlatCompat({
25+
// baseDirectory: __dirname,
26+
// recommendedConfig: js.configs.recommended,
27+
// allConfig: js.configs.all
28+
// });
29+
30+
// export default [...fixupConfigRules(compat.extends(
31+
// "airbnb-typescript",
32+
// "react-app",
33+
// "plugin:prettier/recommended",
34+
// "prettier",
35+
// )), {
36+
// plugins: {
37+
// prettier: fixupPluginRules(prettier),
38+
// },
39+
40+
// languageOptions: {
41+
// ecmaVersion: 5,
42+
// sourceType: "script",
43+
44+
// parserOptions: {
45+
// project: "./tsconfig.eslint.json",
46+
// },
47+
// },
48+
49+
// settings: {
50+
// react: {
51+
// version: "99.99.99",
52+
// },
53+
// },
54+
55+
// rules: {
56+
// "@typescript-eslint/no-explicit-any": "off",
57+
// "max-classes-per-file": "off",
58+
// "no-underscore-dangle": "off",
59+
// "import/extensions": "off",
60+
// },
61+
// }];

jest.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

package.json

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"dependencies": {
5353
"@types/d3-geo": "^3.1.0",
5454
"@types/d3-scale-chromatic": "^3.0.3",
55-
"@types/topojson-client": "^3.1.4",
55+
"@types/topojson-client": "^3.1.5",
5656
"d3-array": "^3.2.4",
5757
"d3-color": "^3.1.0",
5858
"d3-geo": "^3.1.1",
@@ -62,77 +62,59 @@
6262
},
6363
"devDependencies": {
6464
"@chiogen/rollup-plugin-terser": "^7.1.3",
65-
"@rollup/plugin-commonjs": "^26.0.1",
66-
"@rollup/plugin-node-resolve": "^15.2.3",
67-
"@rollup/plugin-replace": "^5.0.7",
68-
"@rollup/plugin-typescript": "^11.1.6",
69-
"@types/jest": "^29.5.12",
65+
"@eslint/js": "^9.11.1",
66+
"@rollup/plugin-commonjs": "^28.0.0",
67+
"@rollup/plugin-node-resolve": "^15.3.0",
68+
"@rollup/plugin-replace": "^6.0.1",
69+
"@rollup/plugin-typescript": "^12.1.0",
7070
"@types/jest-image-snapshot": "^6.4.0",
71-
"@types/node": "^22.5.4",
72-
"@types/seedrandom": "^3.0.8",
73-
"@typescript-eslint/eslint-plugin": "^8.4.0",
74-
"@typescript-eslint/parser": "^8.4.0",
75-
"@yarnpkg/pnpify": "^4.1.1",
71+
"@types/node": "^22.7.4",
7672
"@yarnpkg/sdks": "^3.2.0",
7773
"canvas": "^2.11.2",
7874
"canvas-5-polyfill": "^0.1.5",
7975
"chart.js": "^4.4.4",
80-
"chartjs-plugin-datalabels": "^2.2.0",
81-
"eslint": "^9.10.0",
82-
"eslint-config-airbnb-typescript": "^18.0.0",
83-
"eslint-config-prettier": "^9.1.0",
84-
"eslint-config-react-app": "^7.0.1",
85-
"eslint-plugin-flowtype": "^8.0.3",
86-
"eslint-plugin-import": "^2.30.0",
87-
"eslint-plugin-jsx-a11y": "^6.10.0",
76+
"eslint": "^9.11.1",
8877
"eslint-plugin-prettier": "^5.2.1",
89-
"eslint-plugin-react": "^7.35.2",
90-
"eslint-plugin-react-hooks": "^4.6.2",
91-
"jest": "^29.7.0",
92-
"jest-environment-jsdom": "^29.7.0",
9378
"jest-image-snapshot": "^6.4.0",
79+
"jsdom": "^25.0.1",
9480
"prettier": "^3.3.3",
9581
"rimraf": "^6.0.1",
96-
"rollup": "^4.21.2",
82+
"rollup": "^4.22.5",
9783
"rollup-plugin-cleanup": "^3.2.1",
9884
"rollup-plugin-dts": "^6.1.1",
99-
"seedrandom": "^3.0.5",
10085
"ts-jest": "^29.2.5",
10186
"tslib": "^2.7.0",
102-
"typedoc": "^0.26.6",
103-
"typedoc-plugin-markdown": "^4.2.7",
87+
"typedoc": "^0.26.7",
88+
"typedoc-plugin-markdown": "^4.2.8",
10489
"typedoc-vitepress-theme": "^1.0.1",
105-
"typescript": "^5.5.4",
106-
"us-atlas": "^3.0.1",
90+
"typescript": "^5.6.2",
91+
"typescript-eslint": "^8.7.0",
92+
"vite": "^5.4.8",
10793
"vitepress": "^1.3.4",
108-
"vue": "^3.5.3",
109-
"vue-chartjs": "^5.3.1",
110-
"world-atlas": "^2.0.2"
111-
},
112-
"resolutions": {
113-
"@typescript-eslint/eslint-plugin": "^7.2.0",
114-
"@typescript-eslint/parser": "^7.2.0"
94+
"vitest": "^2.1.1",
95+
"vue": "^3.5.10",
96+
"vue-chartjs": "^5.3.1"
11597
},
11698
"scripts": {
11799
"clean": "rimraf --glob build node_modules \"*.tgz\" \"*.tsbuildinfo\"",
118100
"compile": "tsc -b tsconfig.c.json",
119101
"start": "yarn run watch",
120102
"watch": "rollup -c -w",
121103
"build": "rollup -c",
122-
"test": "yarn node --experimental-vm-modules $(yarn bin jest) --passWithNoTests --detectOpenHandles --forceExit",
104+
"test": "vitest --passWithNoTests",
123105
"test:watch": "yarn run test --watch",
124106
"test:coverage": "yarn run test --coverage",
125107
"lint": "yarn run eslint && yarn run prettier",
126108
"fix": "yarn run eslint:fix && yarn run prettier:write",
127109
"prettier:write": "prettier \"*\" \"*/**\" --write",
128110
"prettier": "prettier \"*\" \"*/**\" --check",
129-
"eslint": "eslint src --ext .ts,.tsx --cache",
111+
"eslint": "eslint src --cache",
130112
"eslint:fix": "yarn run eslint --fix",
131113
"prepare": "yarn run build",
132114
"docs:api": "typedoc --options typedoc.json",
133115
"docs:dev": "vitepress dev docs",
134116
"docs:build": "yarn run docs:api && vitepress build docs",
135117
"docs:preview": "vitepress preview docs"
136118
},
137-
"packageManager": "yarn@4.4.1"
119+
"packageManager": "yarn@4.5.0"
138120
}

src/__tests__/createChart.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/// <reference types="jest" />
21
/// <reference types="node" />
32

3+
import { expect } from 'vitest';
44
import { Chart, ChartConfiguration, defaults, ChartType, DefaultDataPoint } from 'chart.js';
55
import { toMatchImageSnapshot, MatchImageSnapshotOptions } from 'jest-image-snapshot';
66
import 'canvas-5-polyfill';
@@ -12,7 +12,7 @@ function toBuffer(canvas: HTMLCanvasElement) {
1212
canvas.toBlob((b) => {
1313
const file = new FileReader();
1414
file.onload = () => resolve(Buffer.from(file.result as ArrayBuffer));
15-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
15+
1616
file.readAsArrayBuffer(b!);
1717
});
1818
});
@@ -40,7 +40,7 @@ export default function createChart<
4040
canvas.height = height;
4141
Object.assign(defaults.font, { family: 'Courier New' });
4242
// defaults.color = 'transparent';
43-
// eslint-disable-next-line no-param-reassign
43+
4444
config.options = {
4545
responsive: false,
4646
animation: {
@@ -56,7 +56,7 @@ export default function createChart<
5656
},
5757
...(config.options || {}),
5858
} as any;
59-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
59+
6060
const ctx = canvas.getContext('2d')!;
6161

6262
const t = new Chart<TYPE, DATA, LABEL>(ctx, config);

src/controllers/BubbleMapController.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import createChart from '../__tests__/createChart';
1515
import { BubbleMapController } from './BubbleMapController';
1616
import data from './__tests__/data';
17-
17+
import { describe, beforeAll, test } from 'vitest';
1818
const require = createRequire(import.meta.url); // construct the require method
1919
const states10m = require('us-atlas/states-10m.json');
2020

src/controllers/ChoroplethController.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '../scales';
1313
import { ChoroplethController } from './ChoroplethController';
1414
import { GeoFeature } from '../elements';
15-
15+
import { describe, beforeAll, test } from 'vitest';
1616
const require = createRequire(import.meta.url); // construct the require method
1717
const states10m = require('us-atlas/states-10m.json');
1818
const countries50m = require('world-atlas/countries-50m.json');

tsconfig.eslint.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

tsconfig.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@
1818
"noUnusedParameters": true,
1919
"noImplicitReturns": true,
2020
"noFallthroughCasesInSwitch": true,
21-
"moduleResolution": "node",
21+
"moduleResolution": "Bundler",
2222
"jsx": "react",
2323
"esModuleInterop": true,
2424
"rootDir": "./src",
2525
"baseUrl": "./",
2626
"noEmit": true,
2727
"paths": {
2828
"@": ["./src"],
29-
"*": ["*", "node_modules/*"]
29+
"*": ["*", "node_modules/*"],
30+
// workaround for: https://github.com/vitest-dev/vitest/issues/4567
31+
"rollup/parseAst": ["./node_modules/rollup/dist/parseAst"]
3032
}
3133
},
3234
"include": ["src/**/*.ts", "src/**/*.tsx", "docs/**/*.tsx"]

vitest.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/// <reference types="vitest/config" />
2+
import { defineConfig } from 'vite';
3+
4+
export default defineConfig({
5+
test: {
6+
environment: 'jsdom',
7+
root: './src',
8+
},
9+
});

0 commit comments

Comments
 (0)