Skip to content

Commit f4df3f8

Browse files
authored
Merge pull request #240 from sgratzl/upgrade
build: upgrade dependencies
2 parents 3badda9 + 44dbf59 commit f4df3f8

21 files changed

+2892
-7088
lines changed

.eslintrc.cjs

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

.yarn/releases/yarn-4.2.2.cjs

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

.yarn/releases/yarn-4.5.0.cjs

Lines changed: 925 additions & 0 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.2.2.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: 30 additions & 43 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,64 @@
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": "^20.14.2",
72-
"@types/seedrandom": "^3.0.8",
73-
"@typescript-eslint/eslint-plugin": "^7.12.0",
74-
"@typescript-eslint/parser": "^7.12.0",
75-
"@yarnpkg/pnpify": "^4.1.0",
76-
"@yarnpkg/sdks": "^3.1.2",
71+
"@types/node": "^22.7.4",
72+
"@types/seedrandom": "^3",
73+
"@yarnpkg/sdks": "^3.2.0",
7774
"canvas": "^2.11.2",
7875
"canvas-5-polyfill": "^0.1.5",
79-
"chart.js": "^4.4.3",
76+
"chart.js": "^4.4.4",
8077
"chartjs-plugin-datalabels": "^2.2.0",
81-
"eslint": "^8.57.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.29.1",
87-
"eslint-plugin-jsx-a11y": "^6.8.0",
88-
"eslint-plugin-prettier": "^5.1.3",
89-
"eslint-plugin-react": "^7.34.2",
90-
"eslint-plugin-react-hooks": "^4.6.2",
91-
"jest": "^29.7.0",
92-
"jest-environment-jsdom": "^29.7.0",
78+
"eslint": "^9.11.1",
79+
"eslint-plugin-prettier": "^5.2.1",
9380
"jest-image-snapshot": "^6.4.0",
94-
"prettier": "^3.3.1",
95-
"rimraf": "^5.0.7",
96-
"rollup": "^4.18.0",
81+
"jsdom": "^25.0.1",
82+
"prettier": "^3.3.3",
83+
"rimraf": "^6.0.1",
84+
"rollup": "^4.22.5",
9785
"rollup-plugin-cleanup": "^3.2.1",
9886
"rollup-plugin-dts": "^6.1.1",
9987
"seedrandom": "^3.0.5",
100-
"ts-jest": "^29.1.4",
101-
"tslib": "^2.6.3",
102-
"typedoc": "^0.25.13",
103-
"typedoc-plugin-markdown": "^4.0.3",
104-
"typedoc-vitepress-theme": "^1.0.0",
105-
"typescript": "^5.4.5",
88+
"ts-jest": "^29.2.5",
89+
"tslib": "^2.7.0",
90+
"typedoc": "^0.26.7",
91+
"typedoc-plugin-markdown": "^4.2.8",
92+
"typedoc-vitepress-theme": "^1.0.1",
93+
"typescript": "^5.6.2",
94+
"typescript-eslint": "^8.7.0",
10695
"us-atlas": "^3.0.1",
107-
"vitepress": "^1.2.3",
108-
"vue": "^3.4.27",
96+
"vite": "^5.4.8",
97+
"vitepress": "^1.3.4",
98+
"vitest": "^2.1.1",
99+
"vue": "^3.5.10",
109100
"vue-chartjs": "^5.3.1",
110101
"world-atlas": "^2.0.2"
111102
},
112-
"resolutions": {
113-
"@typescript-eslint/eslint-plugin": "^7.2.0",
114-
"@typescript-eslint/parser": "^7.2.0"
115-
},
116103
"scripts": {
117104
"clean": "rimraf --glob build node_modules \"*.tgz\" \"*.tsbuildinfo\"",
118105
"compile": "tsc -b tsconfig.c.json",
119106
"start": "yarn run watch",
120107
"watch": "rollup -c -w",
121108
"build": "rollup -c",
122-
"test": "yarn node --experimental-vm-modules $(yarn bin jest) --passWithNoTests --detectOpenHandles --forceExit",
109+
"test": "vitest --passWithNoTests",
123110
"test:watch": "yarn run test --watch",
124111
"test:coverage": "yarn run test --coverage",
125112
"lint": "yarn run eslint && yarn run prettier",
126113
"fix": "yarn run eslint:fix && yarn run prettier:write",
127114
"prettier:write": "prettier \"*\" \"*/**\" --write",
128115
"prettier": "prettier \"*\" \"*/**\" --check",
129-
"eslint": "eslint src --ext .ts,.tsx --cache",
116+
"eslint": "eslint src --cache",
130117
"eslint:fix": "yarn run eslint --fix",
131118
"prepare": "yarn run build",
132119
"docs:api": "typedoc --options typedoc.json",
133120
"docs:dev": "vitepress dev docs",
134121
"docs:build": "yarn run docs:api && vitepress build docs",
135122
"docs:preview": "vitepress preview docs"
136123
},
137-
"packageManager": "yarn@4.2.2"
124+
"packageManager": "yarn@4.5.0"
138125
}

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/BubbleMapController.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,18 @@ export class BubbleMapController extends GeoController<'bubbleMap', MyPointEleme
4141
meta.rScale = this.getScaleForId('size');
4242
meta.vScale = meta.rScale;
4343
meta.iScale = meta.xScale;
44-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
44+
4545
meta.iAxisID = meta.xAxisID!;
46-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
46+
4747
dataset.iAxisID = meta.xAxisID!;
4848
}
4949

50-
// eslint-disable-next-line class-methods-use-this
5150
_getOtherScale(scale: Scale): Scale {
5251
// for strange get min max with other scale
5352
return scale;
5453
}
5554

5655
parse(start: number, count: number): void {
57-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
5856
const rScale = this.getMeta().rScale!;
5957
const data = this.getDataset().data as unknown as IBubbleMapDataPoint[];
6058
const meta = this._cachedMeta;
@@ -71,7 +69,7 @@ export class BubbleMapController extends GeoController<'bubbleMap', MyPointEleme
7169
updateElements(elems: MyPointElement[], start: number, count: number, mode: UpdateMode): void {
7270
const reset = mode === 'reset';
7371
const firstOpts = this.resolveDataElementOptions(start, mode);
74-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
72+
7573
const sharedOptions = this.getSharedOptions(firstOpts)!;
7674
const includeOptions = this.includeOptions(mode, sharedOptions);
7775
const scale = this.getProjectionScale();

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');

src/controllers/ChoroplethController.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,18 @@ export class ChoroplethController extends GeoController<'choropleth', GeoFeature
3535
meta.rScale = this.getScaleForId('color');
3636
meta.vScale = meta.rScale;
3737
meta.iScale = meta.xScale;
38-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38+
3939
meta.iAxisID = meta.xAxisID!;
40-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
40+
4141
dataset.iAxisID = meta.xAxisID!;
4242
}
4343

44-
// eslint-disable-next-line class-methods-use-this
4544
_getOtherScale(scale: Scale): Scale {
4645
// for strange get min max with other scale
4746
return scale;
4847
}
4948

5049
parse(start: number, count: number): void {
51-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
5250
const rScale = this.getMeta().rScale!;
5351
const { data } = this.getDataset();
5452
const meta = this._cachedMeta;
@@ -61,7 +59,7 @@ export class ChoroplethController extends GeoController<'choropleth', GeoFeature
6159

6260
updateElements(elems: GeoFeature[], start: number, count: number, mode: UpdateMode): void {
6361
const firstOpts = this.resolveDataElementOptions(start, mode);
64-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
62+
6563
const sharedOptions = this.getSharedOptions(firstOpts)!;
6664
const includeOptions = this.includeOptions(mode, sharedOptions);
6765
const scale = this.getProjectionScale();

src/controllers/GeoController.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export class GeoController<
101101
const dirtyCache = scale.updateBounds();
102102

103103
if (this.showOutline()) {
104-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
105104
const elem = meta.dataset!;
106105
if (dirtyCache) {
107106
delete elem.cache;
@@ -125,7 +124,6 @@ export class GeoController<
125124

126125
this.updateElements(meta.data, 0, meta.data.length, mode);
127126
if (dirtyCache) {
128-
// eslint-disable-next-line no-param-reassign
129127
meta.data.forEach((elem) => delete (elem as any).cache);
130128
}
131129
}
@@ -189,7 +187,6 @@ export class GeoController<
189187
}
190188

191189
if (this.showOutline() && this.getMeta().dataset) {
192-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
193190
(this.getMeta().dataset!.draw.call as any)(this.getMeta().dataset!, chart.ctx, chart.chartArea);
194191
}
195192

src/scales/ColorScale.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,6 @@ declare module 'chart.js' {
341341
};
342342
}
343343

344-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
344+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
345345
export interface ScaleTypeRegistry extends ColorScaleTypeRegistry {}
346346
}

0 commit comments

Comments
 (0)