Skip to content

Commit 22296e2

Browse files
kyleshikeKyle Shike
authored andcommitted
Updates node to 20, React to 18, FA peer dep to latest (#1180)
1 parent 6ee8eaa commit 22296e2

File tree

12 files changed

+385
-188
lines changed

12 files changed

+385
-188
lines changed

.eslintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@
116116
{
117117
"files": "**/*.{ts,tsx}",
118118
"rules": {
119-
"react/require-default-props": "off"
119+
"react/require-default-props": "off",
120+
"no-shadow": "off",
121+
"@typescript-eslint/no-shadow": "error",
120122
}
121123
}
122124
],

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ lib
2525

2626
# Ignore Jetbrains IDE settings
2727
/.idea
28+
/.vscode
2829

2930
npm-debug.log*
3031
yarn-debug.log*

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.18.2
1+
20.12.1

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
"@tiptap/pm": "^2.0.3",
2020
"@tiptap/react": "^2.0.3",
2121
"@tiptap/suggestion": "^2.1.13",
22-
"@typescript-eslint/eslint-plugin": "^2",
23-
"@typescript-eslint/parser": "^2",
2422
"react-bootstrap": "^2.5.0",
2523
"react-currency-input-field": "^3.6.10",
2624
"react-loading-skeleton": "^3.1.0",
@@ -70,12 +68,12 @@
7068
"bootstrap": "5.1",
7169
"classnames": "^2.2.5",
7270
"prop-types": "^15.6.1",
73-
"react": "^16.12.0",
71+
"react": "^18.2.0",
7472
"react-copy-to-clipboard": "^5.0.2",
75-
"react-dom": "^16.12.0",
73+
"react-dom": "^18.2.0",
7674
"react-modal": "^3.12.1",
7775
"react-popper": "^2.2.3",
78-
"react-tracking": "^8.1.0"
76+
"react-tracking": "^9.3"
7977
},
8078
"devDependencies": {
8179
"@babel/cli": "^7.8.4",
@@ -109,13 +107,16 @@
109107
"@storybook/addons": "^7.6.17",
110108
"@storybook/react": "^8.0.5",
111109
"@storybook/react-webpack5": "^8.0.5",
110+
"@testing-library/dom": "^9.3.4",
112111
"@testing-library/jest-dom": "^6.1.3",
113-
"@testing-library/react": "^12.1.2",
112+
"@testing-library/react": "^14.2.2",
114113
"@testing-library/react-hooks": "^3.2.1",
115-
"@testing-library/user-event": "^13.5.0",
114+
"@testing-library/user-event": "^14.5.2",
116115
"@types/jest": "^29.5.5",
117116
"@types/react-dom": "^16.0.0",
118117
"@types/testing-library__jest-dom": "^6.0.0",
118+
"@typescript-eslint/eslint-plugin": "^6.21",
119+
"@typescript-eslint/parser": "^6.21",
119120
"babel-eslint": "^10.0.3",
120121
"babel-jest": "^27.4.6",
121122
"babel-loader": "^8.0.6",
@@ -128,27 +129,26 @@
128129
"css-loader": "^6.8.1",
129130
"eslint": "^7.32.0",
130131
"eslint-config-airbnb": "^18.0.1",
131-
"eslint-config-react-app": "^5.2.1",
132132
"eslint-plugin-babel": "^5.3.0",
133133
"eslint-plugin-flowtype": "^4.7.0",
134134
"eslint-plugin-import": "^2.20.1",
135135
"eslint-plugin-jsx-a11y": "^6.2.3",
136136
"eslint-plugin-react": "^7.18.3",
137-
"eslint-plugin-react-hooks": "^2.5.1",
137+
"eslint-plugin-react-hooks": "^4.6.0",
138138
"eslint-utils": "^1.4.3",
139139
"file-loader": "^6.2.0",
140140
"jest": "^27.4.6",
141141
"jest-css-modules-transform": "^4.3.0",
142142
"node-sass": "^8.0.0",
143143
"nodemon": "^3.0.1",
144144
"prop-types": "^15.6.1",
145-
"react": "^18.0.2",
145+
"react": "^18.2.0",
146146
"react-copy-to-clipboard": "^5.0.2",
147-
"react-dom": "^18.0.2",
147+
"react-dom": "^18.2.0",
148148
"react-modal": "^3.12.1",
149149
"react-popper": "^2.2.3",
150150
"react-test-renderer": "^18.0.2",
151-
"react-tracking": "8.1.0",
151+
"react-tracking": "^9.3",
152152
"sass-loader": "^10.4.1",
153153
"storybook": "^8.0.5",
154154
"storybook-addon-designs": "6.3.1",
@@ -161,7 +161,6 @@
161161
"@babel/helper-create-regexp-features-plugin": "^7.22.15",
162162
"istanbul-lib-instrument": "^6.0.0",
163163
"jackspeak": "2.1.1",
164-
"make-dir": "4.0.0",
165164
"normalize-package-data": "^3.0.0",
166165
"semver": "^7.5.3"
167166
},
@@ -171,7 +170,7 @@
171170
"scss"
172171
],
173172
"engines": {
174-
"node": ">= 16 < 19",
173+
"node": ">= 20",
175174
"yarn": "^ 1.22"
176175
},
177176
"main": "lib/index",
@@ -198,4 +197,4 @@
198197
"node": "18.18.2",
199198
"yarn": "1.22.21"
200199
}
201-
}
200+
}

src/Drawer/Drawer.test.jsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react';
22
import propTypes from 'prop-types';
33

4-
import { render, screen } from '@testing-library/react';
4+
import { render, screen, waitFor } from '@testing-library/react';
55
import userEvent from '@testing-library/user-event';
66

77
import Drawer from './Drawer';
@@ -188,14 +188,15 @@ describe('Drawer', () => {
188188
expect(elements.drawerOverlay.get().classList).toContain('DrawerBackgroundOverlay--active');
189189
});
190190

191-
it('calls onRequestClose when pressing ESC key', () => {
191+
it('calls onRequestClose when pressing ESC key', async () => {
192192
const onRequestClose = jest.fn();
193193

194194
render(<SetupDrawerWithChildren visible onRequestClose={onRequestClose} />);
195195

196196
userEvent.keyboard('{Escape}');
197-
198-
expect(onRequestClose).toHaveBeenCalled();
197+
await waitFor(() => {
198+
expect(onRequestClose).toHaveBeenCalled();
199+
});
199200
});
200201

201202
it('body tag has Drawer--open', () => {
@@ -233,15 +234,16 @@ describe('Drawer', () => {
233234
});
234235

235236
describe('when user clicks on drawerOne toggle visibility button', () => {
236-
it('body tag does not have Drawer--open after click', () => {
237+
it('body tag does not have Drawer--open after click', async () => {
237238
const { container } = render(<SetupMultipleDrawers drawerOneVisibleDefault />);
238239
const body = container.closest('body');
239240

240241
expect(body.classList).toContain('Drawer--open');
241242

242243
userEvent.click(elements.drawerOneToggleVisibilityButton.get());
243-
244-
expect(body.classList).not.toContain('Drawer--open');
244+
await waitFor(() => {
245+
expect(body.classList).not.toContain('Drawer--open');
246+
});
245247
});
246248
});
247249
});
@@ -255,15 +257,16 @@ describe('Drawer', () => {
255257
});
256258

257259
describe('when user clicks on drawerOne toggle visibility button', () => {
258-
it('body tag has Drawer--open after click', () => {
260+
it('body tag has Drawer--open after click', async () => {
259261
const { container } = render(<SetupMultipleDrawers />);
260262
const body = container.closest('body');
261263

262264
expect(body.classList).not.toContain('Drawer--open');
263265

264266
userEvent.click(elements.drawerOneToggleVisibilityButton.get());
265-
266-
expect(body.classList).toContain('Drawer--open');
267+
await waitFor(() => {
268+
expect(body.classList).toContain('Drawer--open');
269+
});
267270
});
268271
});
269272
});

src/Drawer/DrawerFooter.test.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render, screen } from '@testing-library/react';
1+
import { render, screen, waitFor } from '@testing-library/react';
22
import React from 'react';
33
import userEvent from '@testing-library/user-event';
44
import { DrawerFooter } from './index';
@@ -9,7 +9,7 @@ describe('DrawerFooter', () => {
99
);
1010

1111
describe('primary action button', () => {
12-
it('calls the onPrimaryAction callback when clicked', () => {
12+
it('calls the onPrimaryAction callback when clicked', async () => {
1313
const onPrimaryActionMock = jest.fn();
1414

1515
renderDrawerFooter({
@@ -19,7 +19,9 @@ describe('DrawerFooter', () => {
1919

2020
userEvent.click(screen.getByRole('button', { name: 'Primary Action' }));
2121

22-
expect(onPrimaryActionMock).toHaveBeenCalled();
22+
await waitFor(() => {
23+
expect(onPrimaryActionMock).toHaveBeenCalled();
24+
});
2325
});
2426
});
2527
});

src/InputLabel/InputLabel.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'scss/forms/input_label.scss';
88

99
const InputLabel = ({
1010
className,
11-
elementType,
1211
labelHtmlFor,
1312
text,
1413
required,
@@ -38,7 +37,6 @@ const InputLabel = ({
3837

3938
InputLabel.propTypes = {
4039
className: PropTypes.string,
41-
elementType: PropTypes.string,
4240
labelHelperText: PropTypes.string,
4341
labelHtmlFor: PropTypes.string,
4442
required: PropTypes.bool,
@@ -48,7 +46,6 @@ InputLabel.propTypes = {
4846

4947
InputLabel.defaultProps = {
5048
className: '',
51-
elementType: undefined,
5249
labelHelperText: undefined,
5350
labelHtmlFor: '',
5451
required: false,

src/InputLegend/InputLegend.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'scss/forms/input_label.scss';
99

1010
const InputLegend = ({
1111
className,
12-
elementType,
1312
labelHtmlFor,
1413
text,
1514
required,
@@ -39,7 +38,6 @@ const InputLegend = ({
3938

4039
InputLegend.propTypes = {
4140
className: PropTypes.string,
42-
elementType: PropTypes.string,
4341
labelHelperText: PropTypes.string,
4442
labelHtmlFor: PropTypes.string,
4543
required: PropTypes.bool,
@@ -49,7 +47,6 @@ InputLegend.propTypes = {
4947

5048
InputLegend.defaultProps = {
5149
className: '',
52-
elementType: undefined,
5350
labelHelperText: undefined,
5451
labelHtmlFor: '',
5552
required: false,

src/Layout/SidebarView/SidebarView.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export default class SidebarView extends Component {
145145
const sidebarClassName = classNames(
146146
this.props.className,
147147
{
148-
// eslint-disable-next-line @typescript-eslint/camelcase
149148
SidebarView__sidebar: true,
150149
'SidebarView__sidebar--open': this.props.isSidebarOpen,
151150
'SidebarView__sidebar--openable': this.props.isSidebarOpenable,

src/RichTextEditor/RichTextEditor.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import type { IOptions } from 'sanitize-html';
2-
import type { AriaAttributes } from 'react';
32
import type { Extension, Node as TipTapNode, Mark } from '@tiptap/core';
43

54
import './RichTextEditor.scss';
65

7-
import React, { forwardRef, type ForwardedRef, useImperativeHandle } from 'react';
6+
import React, {
7+
forwardRef, useImperativeHandle, type AriaAttributes, type ForwardedRef,
8+
} from 'react';
89

910
import classNames from 'classnames';
1011

0 commit comments

Comments
 (0)