Skip to content

Commit 389931a

Browse files
authored
build: Update TypeScript to 5.9 (#980)
* Update TS to 5.9 * Update Storybook to v6.5.17 alpha for TS 5.0 compatibility * Force storybook to use a newer version of fork-ts-checker-webpack-plugin * Fix verbatimModuleSyntax errors
1 parent 67d7d0d commit 389931a

File tree

28 files changed

+2565
-457
lines changed

28 files changed

+2565
-457
lines changed

package-lock.json

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

package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"@babel/register": "^7.0.0",
8383
"@doist/eslint-config": "12.0.0",
8484
"@doist/prettier-config": "4.0.0",
85-
"@doist/tsconfig": "^1.0.0",
85+
"@doist/tsconfig": "2.0.0",
8686
"@geometricpanda/storybook-addon-badges": "^0.2.2",
8787
"@rollup/plugin-commonjs": "28.0.9",
8888
"@rollup/plugin-node-resolve": "16.0.3",
@@ -97,7 +97,7 @@
9797
"@storybook/addon-postcss": "^2.0.0",
9898
"@storybook/addons": "^6.5.3",
9999
"@storybook/jest": "^0.0.10",
100-
"@storybook/react": "^6.5.3",
100+
"@storybook/react": "6.5.17-alpha.0",
101101
"@storybook/testing-library": "^0.0.13",
102102
"@testing-library/jest-dom": "^5.14.1",
103103
"@testing-library/react": "^12.0.0",
@@ -127,6 +127,7 @@
127127
"eslint-plugin-jsx-a11y": "^6.5.1",
128128
"eslint-plugin-prettier": "5.5.4",
129129
"eslint-plugin-react": "7.37.5",
130+
"fork-ts-checker-webpack-plugin": "6.5.3",
130131
"husky": "^4.3.0",
131132
"jest": "^28.1.0",
132133
"jest-axe": "^5.0.1",
@@ -156,7 +157,7 @@
156157
"svg-url-loader": "^6.0.0",
157158
"ts-loader": "^8.0.2",
158159
"tslib": "^2.0.0",
159-
"typescript": "^4.8.3",
160+
"typescript": "5.9.3",
160161
"webpack": "^4.43.0"
161162
},
162163
"dependencies": {
@@ -168,5 +169,8 @@
168169
"react-keyed-flatten-children": "^1.3.0",
169170
"react-markdown": "^5.0.3",
170171
"use-callback-ref": "^1.3.0"
172+
},
173+
"overrides": {
174+
"fork-ts-checker-webpack-plugin": "$fork-ts-checker-webpack-plugin"
171175
}
172176
}

src/avatar/avatar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import * as React from 'react'
22

33
import { Box } from '../box'
4-
import { getClassNames, ResponsiveProp } from '../utils/responsive-props'
4+
import { getClassNames } from '../utils/responsive-props'
55

66
import { emailToIndex, getInitials } from './utils'
77

88
import styles from './avatar.module.css'
99

1010
import type { ObfuscatedClassName } from '../utils/common-types'
11+
import type { ResponsiveProp } from '../utils/responsive-props'
1112

1213
const AVATAR_COLORS = [
1314
'#fcc652',

src/banner/banner.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { render, screen, within } from '@testing-library/react'
44
import userEvent from '@testing-library/user-event'
55
import { axe } from 'jest-axe'
66

7-
import { Banner, SystemBannerType } from './banner'
7+
import { Banner } from './banner'
8+
9+
import type { SystemBannerType } from './banner'
810

911
describe('Banner', () => {
1012
it('renders as a <div /> element', () => {

src/banner/banner.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import * as React from 'react'
22

33
import { Box } from '../box'
4-
import { Button, ButtonProps, IconButton } from '../button'
4+
import { Button, IconButton } from '../button'
55
import { BannerIcon } from '../icons/banner-icon'
66
import { CloseIcon } from '../icons/close-icon'
77
import { TextLink } from '../text-link'
88
import { useId } from '../utils/common-helpers'
99

1010
import styles from './banner.module.css'
1111

12+
import type { ButtonProps } from '../button'
13+
1214
/**
1315
* Represents the type of a banner.
1416
* 'neutral' accepts a custom icon, the rest do not.

src/base-field/base-field.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react'
22

3-
import { Box, BoxProps } from '../box'
3+
import { Box } from '../box'
44
import { Column, Columns } from '../columns'
55
import { Spinner } from '../spinner'
66
import { Stack } from '../stack'
@@ -9,6 +9,7 @@ import { useId } from '../utils/common-helpers'
99

1010
import styles from './base-field.module.css'
1111

12+
import type { BoxProps } from '../box'
1213
import type { WithEnhancedClassName } from '../utils/common-types'
1314

1415
// Define the remaining characters before the character count turns red

src/box/box.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Inline } from '../inline'
55
import { Stack } from '../stack'
66
import { Text } from '../text'
77
import {
8-
PartialProps,
98
Placeholder,
109
ResponsiveWidthRef,
1110
reusableBoxProps,
@@ -15,9 +14,10 @@ import {
1514
Wrapper,
1615
} from '../utils/storybook-helper'
1716

18-
import { Box, BoxBorderRadius } from './box'
17+
import { Box } from './box'
1918

2019
import type { Space, SpaceWithNegatives } from '../utils/common-types'
20+
import type { PartialProps } from '../utils/storybook-helper'
2121
import type {
2222
BoxAlignItems,
2323
BoxBackground,
@@ -29,6 +29,7 @@ import type {
2929
BoxPaddingProps,
3030
BoxTextAlign,
3131
} from './'
32+
import type { BoxBorderRadius } from './box'
3233

3334
export default {
3435
title: 'Design system/Box',

src/box/box.test.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import * as React from 'react'
33
import { render, screen } from '@testing-library/react'
44
import { axe } from 'jest-axe'
55

6-
import { Box, BoxProps } from './'
6+
import { Box } from './'
7+
8+
import type { BoxProps } from './'
79

810
describe('Box', () => {
911
it('renders its children as its content', () => {

src/button/button.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import * as React from 'react'
22

3-
import { Role, RoleProps } from '@ariakit/react'
3+
import { Role } from '@ariakit/react'
44
import classNames from 'classnames'
55

66
import { Box, getBoxClassNames } from '../box'
77
import { Spinner } from '../spinner'
8-
import { Tooltip, TooltipProps } from '../tooltip'
8+
import { Tooltip } from '../tooltip'
99

1010
import styles from './button.module.css'
1111

12+
import type { RoleProps } from '@ariakit/react'
13+
import type { TooltipProps } from '../tooltip'
1214
import type { ObfuscatedClassName } from '../utils/common-types'
1315

1416
function preventDefault(event: React.SyntheticEvent) {

src/columns/columns.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { Box } from '../box'
44
import { Stack } from '../stack'
55
import {
66
disableResponsiveProps,
7-
PartialProps,
87
Placeholder,
98
ResponsiveWidthRef,
109
reusableBoxProps,
@@ -16,6 +15,7 @@ import {
1615

1716
import { Column, Columns } from './columns'
1817

18+
import type { PartialProps } from '../utils/storybook-helper'
1919
import type {
2020
ColumnsCollapseBelow,
2121
ColumnsHorizontalAlignment,

0 commit comments

Comments
 (0)