Skip to content

Commit d23eba8

Browse files
authored
test(deps): reconfigure for ESLint v9 (#1643)
update eslint to 9.30.1 update eslint-plugin-cypress to 5.1.0 add typescript-eslint 8.35.1 add @typescript-eslint/parser 8.35.1 remove eslint-config-prettier remove eslint-plugin-prettier remove eslint-config-react-app
1 parent 484fbe5 commit d23eba8

File tree

8 files changed

+384
-1966
lines changed

8 files changed

+384
-1966
lines changed

eslint.config.mjs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import globals from 'globals'
2+
import { defineConfig } from 'eslint/config'
3+
import pluginJs from '@eslint/js'
4+
import pluginTs from 'typescript-eslint'
5+
import pluginTsParser from '@typescript-eslint/parser'
6+
import pluginCypress from 'eslint-plugin-cypress'
7+
8+
export default defineConfig([
9+
{
10+
ignores: ['build/'],
11+
},
12+
{
13+
files: ['**/*.ts'],
14+
languageOptions: {
15+
parser: pluginTsParser,
16+
},
17+
},
18+
pluginJs.configs.recommended,
19+
pluginTs.configs.recommended,
20+
pluginCypress.configs.recommended,
21+
{
22+
rules: {
23+
// TO-DO review violations of disabled rules
24+
'no-empty': 'off',
25+
'no-prototype-builtins': 'off',
26+
'no-undef': 'off',
27+
'no-unused-vars': 'off',
28+
'prefer-const': 'off',
29+
'@typescript-eslint/ban-ts-comment': 'off',
30+
'@typescript-eslint/no-empty-object-type': 'off',
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
33+
'@typescript-eslint/no-unsafe-function-type': 'off',
34+
'@typescript-eslint/no-unused-expressions': 'off',
35+
'@typescript-eslint/no-wrapper-object-types': 'off',
36+
'@typescript-eslint/no-unused-vars': 'off',
37+
'@typescript-eslint/no-require-imports': 'off',
38+
'@typescript-eslint/triple-slash-reference': 'off',
39+
},
40+
languageOptions: {
41+
globals: {
42+
...globals.node,
43+
},
44+
}
45+
}
46+
])

package.json

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"@types/validator": "13.7.2",
9191
"@types/webpack-env": "1.16.4",
9292
"@types/yup": "0.29.13",
93+
"@typescript-eslint/parser": "^8.35.1",
9394
"@vitejs/plugin-react": "^4.0.2",
9495
"bcryptjs": "2.4.3",
9596
"concurrently": "9.1.2",
@@ -98,11 +99,8 @@
9899
"cross-env": "7.0.3",
99100
"cypress": "^14.3.2",
100101
"dotenv": "16.0.0",
101-
"eslint": "^8.44.0",
102-
"eslint-config-prettier": "8.10.0",
103-
"eslint-config-react-app": "^7.0.1",
104-
"eslint-plugin-cypress": "3.5.0",
105-
"eslint-plugin-prettier": "^5.0.0",
102+
"eslint": "^9.30.1",
103+
"eslint-plugin-cypress": "^5.1.0",
106104
"express": "4.20.0",
107105
"express-jwt": "6.1.2",
108106
"express-paginate": "1.0.2",
@@ -132,6 +130,7 @@
132130
"start-server-and-test": "1.14.0",
133131
"ts-node": "10.9.2",
134132
"typescript": "5.8.3",
133+
"typescript-eslint": "^8.35.1",
135134
"vite": "^4.4.2",
136135
"vite-plugin-eslint": "^1.8.1",
137136
"vite-plugin-istanbul": "^4.1.0",
@@ -195,23 +194,6 @@
195194
"engines": {
196195
"node": "^20.0.0 || ^22.0.0"
197196
},
198-
"eslintConfig": {
199-
"env": {
200-
"cypress/globals": true
201-
},
202-
"extends": [
203-
"react-app",
204-
"plugin:prettier/recommended",
205-
"plugin:cypress/recommended"
206-
],
207-
"plugins": [
208-
"cypress",
209-
"prettier"
210-
],
211-
"rules": {
212-
"no-unused-expressions": 0
213-
}
214-
},
215197
"husky": {
216198
"hooks": {
217199
"pre-push": "yarn types"

scripts/seedDataUtils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/first */
21
require("dotenv").config();
32

43
import shortid from "shortid";

src/components/MainLayout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ const MainLayout: React.FC<Props> = ({ children, notificationsService, authServi
9292
if (!desktopDrawerOpen && aboveSmallBreakpoint) {
9393
openDesktopDrawer({ aboveSmallBreakpoint });
9494
}
95-
// eslint-disable-next-line react-hooks/exhaustive-deps
9695
}, [aboveSmallBreakpoint, desktopDrawerOpen]);
9796

9897
return (

src/containers/AppAuth0.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ const AppAuth0: React.FC = () => {
4242

4343
const [, , bankAccountsService] = useMachine(bankAccountsMachine);
4444

45-
// eslint-disable-next-line react-hooks/rules-of-hooks
4645
useEffect(() => {
4746
(async function waitForToken() {
4847
const token = await getAccessTokenSilently();

src/containers/AppGoogle.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const AppGoogle: React.FC = () => {
4949

5050
// @ts-ignore
5151
if (window.Cypress) {
52-
// eslint-disable-next-line react-hooks/rules-of-hooks
5352
useEffect(() => {
5453
const { user, token } = JSON.parse(localStorage.getItem("googleCypress")!);
5554
authService.send("GOOGLE", {
@@ -58,7 +57,6 @@ const AppGoogle: React.FC = () => {
5857
});
5958
}, []);
6059
} else {
61-
// eslint-disable-next-line react-hooks/rules-of-hooks
6260
useGoogleLogin({
6361
clientId: process.env.VITE_GOOGLE_CLIENTID!,
6462
onSuccess: (res) => {

src/containers/AppOkta.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ const AppOkta: React.FC = () => {
4646

4747
// @ts-ignore
4848
if (window.Cypress && process.env.VITE_OKTA_PROGRAMMATIC) {
49-
// eslint-disable-next-line react-hooks/rules-of-hooks
5049
useEffect(() => {
5150
const okta = JSON.parse(localStorage.getItem("oktaCypress")!);
5251
authService.send("OKTA", {
@@ -55,7 +54,6 @@ const AppOkta: React.FC = () => {
5554
});
5655
}, []);
5756
} else {
58-
// eslint-disable-next-line react-hooks/rules-of-hooks
5957
useEffect(() => {
6058
if (oktaAuthState.isAuthenticated) {
6159
oktaAuthService.getUser().then((user: any) => {

0 commit comments

Comments
 (0)