Skip to content

Commit 2b3c751

Browse files
committed
Bump to typescript 5
1 parent 943bc93 commit 2b3c751

27 files changed

+247
-615
lines changed

babel.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['@babel/preset-env', '@babel/preset-typescript', '@babel/preset-react']
2+
presets: ['@babel/preset-env', '@babel/preset-typescript']
33
}

package-lock.json

Lines changed: 190 additions & 569 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"@jest/globals": "^29.7.0",
7878
"@types/d3": "^7.4.0",
7979
"@types/events": "^3.0.0",
80+
"@types/node": "^18.19.115",
8081
"@typescript-eslint/eslint-plugin": "^5.37.0",
8182
"@typescript-eslint/parser": "^5.37.0",
8283
"babel-eslint": "^10.1.0",
@@ -85,7 +86,6 @@
8586
"core-js": "^3.25.2",
8687
"dox": "^1.0.0",
8788
"eslint": "^8.23.1",
88-
"eslint-config-react-app": "^7.0.1",
8989
"eslint-config-standard": "^17.0.0",
9090
"eslint-plugin-flowtype": "^8.0.3",
9191
"eslint-plugin-import": "^2.26.0",
@@ -114,8 +114,8 @@
114114
"ts-jest-resolver": "^2.0.1",
115115
"ts-loader": "^9.3.1",
116116
"tsx": "^4.6.2",
117-
"typedoc": "^0.23.15",
118-
"typescript": "^4.8.3",
117+
"typedoc": "^0.28.7",
118+
"typescript": "^5.8.3",
119119
"web-worker": "^1.5.0",
120120
"webpack": "^5.86.0",
121121
"webpack-cli": "^5.1.4",

src/chart.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { line as d3Line, Line } from 'd3-shape'
1+
import { line as d3Line, type Line } from 'd3-shape'
22
import { format as d3Format } from 'd3-format'
33
import { scaleLinear as d3ScaleLinear, scaleLog as d3ScaleLog } from 'd3-scale'
4-
import { axisLeft as d3AxisLeft, axisBottom as d3AxisBottom, Axis } from 'd3-axis'
4+
import { axisLeft as d3AxisLeft, axisBottom as d3AxisBottom, type Axis } from 'd3-axis'
55
import { zoom as d3Zoom } from 'd3-zoom'
66
import { select as d3Select, pointer as d3Pointer } from 'd3-selection'
77
import { interpolateRound as d3InterpolateRound } from 'd3-interpolate'
88
import EventEmitter from 'events'
99

10-
import { FunctionPlotDatum, FunctionPlotOptions, FunctionPlotScale, FunctionPlotOptionsAxis } from './types.js'
10+
import type { FunctionPlotDatum, FunctionPlotOptions, FunctionPlotScale, FunctionPlotOptionsAxis } from './types.js'
1111
import { IntervalWorkerPool } from './samplers/interval_worker_pool.js'
1212

1313
import { Mark } from './graph-types/mark.js'

src/datum-defaults.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, it } from '@jest/globals'
2-
import { FunctionPlotDatum } from './types.js'
2+
import type { FunctionPlotDatum } from './types.js'
33
import datumDefaults from '../src/datum-defaults.js'
44

55
describe('datumDefaults', () => {

src/datum-defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FunctionPlotDatum } from './types.js'
1+
import type { FunctionPlotDatum } from './types.js'
22
import { randomId } from './utils.mjs'
33

44
export default function datumDefaults(d: FunctionPlotDatum): FunctionPlotDatum {

src/datum-validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FunctionPlotDatum } from './types.js'
1+
import type { FunctionPlotDatum } from './types.js'
22
import { assert } from './utils.mjs'
33

44
export default function datumValidation(d: FunctionPlotDatum) {

src/evaluate-datum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { syncSamplerInterval, asyncSamplerInterval } from './samplers/interval.j
33
import builtIn from './samplers/builtIn.js'
44

55
import { Chart } from './index.js'
6-
import { FunctionPlotDatum, FunctionPlotScale } from './types.js'
6+
import type { FunctionPlotDatum, FunctionPlotScale } from './types.js'
77

88
/**
99
* Computes the endpoints x_lo, x_hi of the range in d.range from which the sampler will take samples.

src/graph-types/annotation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { line as d3Line } from 'd3-shape'
2-
import { Selection } from 'd3-selection'
2+
import type { Selection } from 'd3-selection'
33

4-
import { FunctionPlotOptions } from '../types.js'
4+
import type { FunctionPlotOptions } from '../types.js'
55
import { Mark } from '../graph-types/mark.js'
66

77
const line = d3Line()

src/graph-types/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Polyline, polyline } from './polyline.js'
33
import { Scatter, scatter } from './scatter.js'
44
import { Text, text } from './text.js'
55
import { Annotation, annotation } from './annotation.js'
6-
import { Attr, Mark } from './mark.js'
6+
import { Mark } from './mark.js'
77

8-
export { Polyline, polyline, Scatter, scatter, Interval, interval, Text, text, Annotation, annotation, Attr, Mark }
8+
export type { Attr } from './mark.js'
9+
export { Polyline, Scatter, Interval, Text, Annotation, Mark }
10+
export { polyline, scatter, interval, text, annotation }

0 commit comments

Comments
 (0)