-
Notifications
You must be signed in to change notification settings - Fork 723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal: upgrade to TypeScript ^5.7.0 #1894
base: master
Are you sure you want to change the base?
Changes from all commits
761d68c
e7ec946
edd6b31
837ee87
43ce203
6ae05a1
646898b
b50f0e2
c58e8c3
bcc7a5a
74f4bf5
44462c6
e988ad3
d006445
1a02cb5
1beb5a3
40d0fb2
9f34870
78b3995
3dc76f4
628c464
fb8bb3f
4abf7f7
afac952
e86e658
c8e2590
3fb907b
31e8b6f
ece9d58
e3f22aa
b7a0edb
fa2f173
b3fcad1
0cb4bc8
548f65a
f43a979
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
require('airbnb-js-shims/target/es2019'); | ||
|
||
// Global mock for getComputedTextLength | ||
SVGElement.prototype.getComputedTextLength = () => 100; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
"charts" | ||
], | ||
"engines": { | ||
"node": ">=16.13.0", | ||
"node": ">=18.18.0", | ||
"yarn": ">=1.17.0" | ||
}, | ||
"contributors": [ | ||
|
@@ -45,6 +45,7 @@ | |
"jest": "NODE_ENV=test jest --coverage --verbose", | ||
"lint": "eslint packages/ --quiet", | ||
"lint:fix": "yarn run lint --fix", | ||
"postinstall": "yarn run ts ./scripts/postInstall.ts", | ||
"prepare-release": "git checkout master && git pull --rebase origin master && lerna updated", | ||
"release": "yarn run prepare-release && lerna publish --exact", | ||
"setup": "yarn run build", | ||
|
@@ -71,20 +72,21 @@ | |
"@testing-library/jest-dom": "^6.6.0", | ||
"@testing-library/react": "^16.1.0", | ||
"@testing-library/user-event": "^13.5.0", | ||
"@types/jest": "^24.0.18", | ||
"@types/jsdom": "^12.2.4", | ||
"@types/jest": "^29.5.14", | ||
"@types/jsdom": "^21.1.7", | ||
"@types/node": "^22.10.2", | ||
"@types/node-fetch": "1.6.9", | ||
"@typescript-eslint/eslint-plugin": "^5.46.1", | ||
"@typescript-eslint/parser": "^5.46.1", | ||
"@typescript-eslint/eslint-plugin": "^8.18.1", | ||
"@typescript-eslint/parser": "^8.18.1", | ||
"airbnb-js-shims": "^2.2.1", | ||
"babel-plugin-typescript-to-proptypes": "^2.0.0", | ||
"chalk": "4.1.0", | ||
"coveralls": "^3.0.6", | ||
"eslint": "^8.30.0", | ||
"eslint": "^8.57.0", | ||
"eslint-config-airbnb": "^19.0.4", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^27.1.7", | ||
"eslint-plugin-jest": "^28.9.0", | ||
"eslint-plugin-jsx-a11y": "^6.6.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-promise": "^6.1.1", | ||
|
@@ -95,7 +97,8 @@ | |
"filesize": "6.1.0", | ||
"fs-jetpack": "^1.3.0", | ||
"husky": "^3.0.0", | ||
"jest": "^25.5.4", | ||
"jest": "^29.7.0", | ||
"jest-environment-jsdom": "^29.7.0", | ||
"jest-mock-console": "^1.0.1", | ||
"lerna": "^7.0.2", | ||
"marked": "^0.7.0", | ||
|
@@ -106,8 +109,8 @@ | |
"react-dom": "^16.0.0-0 || ^17.0.0-0 || ^18.0.0-0 || ^19.0.0-0", | ||
"regenerator-runtime": "^0.10.5", | ||
"timezone-mock": "^1.1.0", | ||
"ts-node": "9.1.1", | ||
"typescript": "^3.8.3" | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.7.0" | ||
}, | ||
"packageManager": "[email protected]", | ||
"workspaces": { | ||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -2,12 +2,13 @@ import React from 'react'; | |||||||
import cx from 'classnames'; | ||||||||
import { Group } from '@visx/group'; | ||||||||
import { getTicks, coerceNumber } from '@visx/scale'; | ||||||||
import { SharedAxisProps, AxisScale } from '../types'; | ||||||||
import type { SharedAxisProps, AxisScale } from '../types'; | ||||||||
import AxisRenderer from './AxisRenderer'; | ||||||||
import getTickPosition from '../utils/getTickPosition'; | ||||||||
import getTickFormatter from '../utils/getTickFormatter'; | ||||||||
import createPoint from '../utils/createPoint'; | ||||||||
import Orientation, { OrientationType } from '../constants/orientation'; | ||||||||
import type { OrientationType } from '../constants/orientation'; | ||||||||
import Orientation from '../constants/orientation'; | ||||||||
Comment on lines
+10
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, instead of splitting those lines up you can also do this:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. had just used the eslint autofix here. this doesn't seem to be configurable https://typescript-eslint.io/rules/consistent-type-imports/. no strong opinion from me. |
||||||||
import getAxisRangePaddingConfig from '../utils/getAxisRangePaddingConfig'; | ||||||||
|
||||||||
export type AxisProps<Scale extends AxisScale> = SharedAxisProps<Scale> & { | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enabled auto-fixing
import { FooType } from './foo'
toimport type { FooType } from './foo'
which TS now cares aboutThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typescript should not require this afaik unless
verbatimModuleSyntax
is enabled 🤔But it's a good practice anyway, so 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was getting
*.d.ts is not a module
errors, but actually fixed that in tsconfig with"moduleResolution": "node16"
but agree this is best practice/we should do it anyway 👍