Skip to content

Commit d90ea34

Browse files
authored
MM-69003 Update ESLint and related dependencies (mattermost#37039)
* Remove everything * Re-add most ESLint plugins and run --fix * Additional fixes * Fix or disable linter warnings caused by require imports * Fix how prop types for SearchResults are defined * More additional fixes * Update deprecated stylistic rule names * Remove deprecated .eslintignore * Update eslint-plugin-react-hooks * Enable react-hooks/error-boundaries * Fix react-hooks/static-components wherever possible * Fix react-hooks/use-memo wherever possible * Disable warnings for new rules and update comment * Update eslint-plugin-no-only-tests * Update eslint dependencies in E2E test packages * Remove now-uneeded patch * Address Coderabbit feedback * Actually fix inverted tooltip logic
1 parent d067d35 commit d90ea34

138 files changed

Lines changed: 1201 additions & 1886 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

e2e-tests/cypress/package-lock.json

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

e2e-tests/cypress/package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
"devDependencies": {
44
"@aws-sdk/client-s3": "3.1030.0",
55
"@aws-sdk/lib-storage": "3.1030.0",
6-
"@babel/eslint-parser": "7.28.6",
7-
"@babel/eslint-plugin": "7.27.1",
86
"@cypress/request": "3.0.10",
97
"@cypress/webpack-preprocessor": "7.1.0",
10-
"@eslint/js": "9.39.3",
118
"@mattermost/client": "11.5.0",
129
"@mattermost/eslint-plugin": "file:../../webapp/platform/eslint-plugin",
1310
"@mattermost/types": "11.5.0",
@@ -24,8 +21,6 @@
2421
"@types/mochawesome": "6.2.5",
2522
"@types/recursive-readdir": "2.2.4",
2623
"@types/shelljs": "0.10.0",
27-
"@typescript-eslint/eslint-plugin": "8.58.2",
28-
"@typescript-eslint/parser": "8.58.2",
2924
"async": "3.2.6",
3025
"authenticator": "1.1.5",
3126
"axios": "1.15.0",
@@ -43,8 +38,8 @@
4338
"deepmerge": "4.3.1",
4439
"dotenv": "17.4.2",
4540
"eslint": "9.39.3",
46-
"eslint-plugin-cypress": "6.3.1",
47-
"eslint-plugin-no-only-tests": "3.3.0",
41+
"eslint-plugin-cypress": "^6.3.1",
42+
"eslint-plugin-no-only-tests": "^3.4.0",
4843
"express": "5.2.1",
4944
"extract-zip": "2.0.1",
5045
"globals": "17.5.0",
@@ -72,7 +67,6 @@
7267
"timezones.json": "1.7.2",
7368
"ts-loader": "9.5.7",
7469
"typescript": "6.0.2",
75-
"typescript-eslint": "8.58.2",
7670
"uuid": "13.0.0",
7771
"yargs": "18.0.0"
7872
},

e2e-tests/playwright/eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default [
3636
'@stylistic/wrap-regex': 'off', // Covered by Prettier
3737
'@typescript-eslint/explicit-module-boundary-types': 'off',
3838
'@typescript-eslint/no-explicit-any': 'off',
39-
'@typescript-eslint/no-var-requires': 'off',
39+
'@typescript-eslint/no-require-imports': 'off',
4040
'func-names': 'off',
4141
'max-lines': ['warn', {max: 800, skipBlankLines: true, skipComments: true}],
4242
'no-await-in-loop': 'off',

e2e-tests/playwright/lib/src/file.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import {resolvePlaywrightPath} from './util';
1111
const commonAssetPath = path.resolve(__dirname, 'asset');
1212
export const assetPath = resolvePlaywrightPath('asset');
1313

14-
const availableFiles = ['mattermost-icon_128x128.png'] as const;
15-
type AvailableFilename = (typeof availableFiles)[number];
14+
type AvailableFilename = 'mattermost-icon_128x128.png';
1615

1716
/**
1817
* Reads file data and creates a File object.

e2e-tests/playwright/package-lock.json

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

e2e-tests/playwright/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"cross-env": "10.1.0",
4141
"dayjs": "1.11.20",
4242
"eslint": "9.39.2",
43-
"eslint-import-resolver-typescript": "4.4.4",
43+
"eslint-import-resolver-typescript": "^4.4.5",
4444
"glob": "13.0.6",
4545
"luxon": "3.7.2",
4646
"prettier": "3.8.2",

webapp/channels/.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

webapp/channels/eslint.config.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
22
// See LICENSE.txt for license information.
33

4+
import {defineConfig, globalIgnores} from 'eslint/config';
45
import formatjsPlugin from 'eslint-plugin-formatjs';
56
import noOnlyTestsPlugin from 'eslint-plugin-no-only-tests';
67

78
import eslintPlugin from '@mattermost/eslint-plugin';
89

9-
export default [
10+
export default defineConfig([
1011
...eslintPlugin.configs.react,
12+
globalIgnores(['./dist']),
1113
{
1214
plugins: {
1315
formatjs: formatjsPlugin,
@@ -83,4 +85,4 @@ export default [
8385
},
8486
},
8587
},
86-
];
88+
]);

webapp/channels/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@
137137
"emoji-datasource": "6.1.1",
138138
"emoji-datasource-apple": "6.1.1",
139139
"emoji-datasource-google": "6.1.1",
140-
"eslint-plugin-no-only-tests": "3.1.0",
140+
"eslint-import-resolver-webpack": "0.13.11",
141+
"eslint-plugin-formatjs": "6.4.15",
142+
"eslint-plugin-no-only-tests": "3.4.0",
141143
"external-remotes-plugin": "1.0.0",
142144
"html-loader": "5.1.0",
143145
"html-webpack-plugin": "5.5.0",
144146
"identity-obj-proxy": "3.0.0",
145147
"image-minimizer-webpack-plugin": "5.0.0",
146-
"svgo": "2.8.2",
147-
"sharp": "0.34.5",
148148
"jest": "30.1.3",
149149
"jest-canvas-mock": "2.5.0",
150150
"jest-cli": "30.1.3",
@@ -155,11 +155,14 @@
155155
"prettier": "2.3.2",
156156
"redux-mock-store": "1.5.4",
157157
"redux-persist-node-storage": "2.0.0",
158+
"sharp": "0.34.5",
158159
"stylelint": "16.10.0",
159160
"stylelint-config-idiomatic-order": "10.0.0",
160161
"stylelint-config-recommended-scss": "14.1.0",
161162
"stylelint-order": "6.0.4",
162163
"stylelint-scss": "6.8.1",
164+
"svgo": "2.8.2",
165+
"typescript-eslint-language-service": "5.0.5",
163166
"webpack-pwa-manifest": "4.3.0",
164167
"yargs": "17.7.2"
165168
},

webapp/channels/src/actions/cloud.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function validateBusinessEmail(email = '') {
2626
try {
2727
const res = await Client4.validateBusinessEmail(email);
2828
return res.data.is_valid;
29-
} catch (error) {
29+
} catch {
3030
return false;
3131
}
3232
};
@@ -37,7 +37,7 @@ export function validateWorkspaceBusinessEmail() {
3737
try {
3838
const res = await Client4.validateWorkspaceBusinessEmail();
3939
return res.data.is_valid;
40-
} catch (error) {
40+
} catch {
4141
return false;
4242
}
4343
};

0 commit comments

Comments
 (0)