MM-52624/MM-57094 Update ESLint and our ESLint plugin (#26398)

* Update ESLint and plugins

* Move most channels-specific ESLint configuration into ESLint plugin

* Add ESLint to types and client packages

* Add ESLint to components package
Этот коммит содержится в:
Harrison Healey
2024-03-13 18:07:28 -04:00
коммит произвёл GitHub
родитель 67f815e373
Коммит 4d03becdd1
53 изменённых файлов: 1149 добавлений и 989 удалений

6
webapp/platform/client/.eslintrc.json Обычный файл
Просмотреть файл

@@ -0,0 +1,6 @@
{
"root": true,
"extends": [
"plugin:@mattermost/base"
]
}

Просмотреть файл

@@ -21,6 +21,7 @@
"form-data": "^4.0.0"
},
"devDependencies": {
"@types/jest": "28.1.8",
"jest": "27.1.0",
"typescript": "^5.0.0"
},
@@ -34,10 +35,11 @@
}
},
"scripts": {
"build": "tsc --build --verbose",
"build": "tsc --build tsconfig.build.json --verbose",
"check": "eslint --ext .js,.jsx,.tsx,.ts ./src --quiet",
"run": "tsc --watch --preserveWatchOutput",
"test": "jest",
"test-ci": "jest --ci --forceExit --detectOpenHandles --maxWorkers=100%",
"clean": "rm -rf lib node_modules tsconfig.tsbuildinfo"
"clean": "rm -rf lib node_modules *.tsbuildinfo"
}
}

Просмотреть файл

@@ -4,7 +4,7 @@
import nock from 'nock';
import Client4, {ClientError, HEADER_X_VERSION_ID} from './client4';
import {TelemetryHandler} from './telemetry';
import type {TelemetryHandler} from './telemetry';
describe('Client4', () => {
beforeAll(() => {

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@@ -2,7 +2,6 @@
// See LICENSE.txt for license information.
import Client4 from './client4';
import {cleanUrlForLogging} from './errors';
describe('cleanUrlForLogging', () => {

Просмотреть файл

@@ -189,16 +189,16 @@ export default class WebSocketClient {
console.log('long timeout, or server restart, or sequence number is not found.'); //eslint-disable-line no-console
this.missedEventCallback?.();
for (const listener of this.missedMessageListeners) {
for (const listener of this.missedMessageListeners) {
try {
listener();
} catch (e) {
console.log(`missed message listener "${listener.name}" failed: ${e}`); // eslint-disable-line no-console
}
}
this.serverSequence = 0;
this.serverSequence = 0;
}
// If it's a fresh connection, we have to set the connectionId regardless.

26
webapp/platform/client/tsconfig.build.json Обычный файл
Просмотреть файл

@@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"target": "es2022",
"declaration": true,
"strict": true,
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"jsx": "react",
"outDir": "./lib",
"rootDir": "./src",
"composite": true,
},
"include": [
"./src/**/*"
],
"exclude": [
"**/*.test.*"
],
"references": [
{"path": "../types"}
]
}

Просмотреть файл

@@ -12,14 +12,11 @@
"jsx": "react",
"outDir": "./lib",
"rootDir": "./src",
"composite": true
"composite": true,
},
"include": [
"./src/**/*"
],
"exclude": [
"**/*.test.*"
],
"references": [
{"path": "../types"}
]