🚨(y-provider) upgrade eslint to v9 with y-provider server
We upgraded ESLint to version 9 in the y-provider server, which includes several improvements and fixes. This change also involves updating the ESLint configuration files to the new format and ensuring compatibility with the latest ESLint features.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: ['impress/jest', 'impress/next'],
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
},
|
||||
settings: {
|
||||
next: {
|
||||
rootDir: __dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'@next/next/no-html-link-for-pages': 'off',
|
||||
},
|
||||
ignorePatterns: ['node_modules'],
|
||||
};
|
||||
@@ -58,7 +58,6 @@ describe('Server Tests', () => {
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.body).toStrictEqual({ message: 'Connections reset' });
|
||||
|
||||
// eslint-disable-next-line jest/unbound-method
|
||||
expect(closeConnectionsMock).toHaveBeenCalledOnce();
|
||||
});
|
||||
});
|
||||
|
||||
26
src/frontend/servers/y-provider/eslint.config.mjs
Normal file
26
src/frontend/servers/y-provider/eslint.config.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
import { defineConfig } from '@eslint/config-helpers';
|
||||
import docsPlugin from 'eslint-plugin-docs';
|
||||
|
||||
const eslintConfig = defineConfig([
|
||||
{
|
||||
ignores: ['dist/**'],
|
||||
},
|
||||
{
|
||||
files: ['**/*.mjs', '**/*.ts', '**/*.tsx'],
|
||||
plugins: {
|
||||
docs: docsPlugin,
|
||||
},
|
||||
extends: ['docs/next'],
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'@next/next/no-html-link-for-pages': 'off',
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
export default eslintConfig;
|
||||
@@ -9,7 +9,7 @@
|
||||
"build": "tsc -p tsconfig.build.json && tsc-alias",
|
||||
"dev": "cross-env COLLABORATION_LOGGING=true && nodemon --config nodemon.json",
|
||||
"start": "node ./dist/start-server.js",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"lint": "eslint",
|
||||
"test": "vitest --run --disable-console-intercept"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -74,9 +74,12 @@ export const hocuspocusServer = Server.configure({
|
||||
*/
|
||||
try {
|
||||
const user = await fetchCurrentUser(requestHeaders);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
context.userId = user.id;
|
||||
} catch {}
|
||||
} catch {
|
||||
/* empty */
|
||||
}
|
||||
|
||||
logger(
|
||||
'Connection established on room:',
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"compilerOptions": {
|
||||
"rootDir": "./src",
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"exclude": ["node_modules", "dist", "__tests__"],
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@
|
||||
"resolveFullPaths": true,
|
||||
"verbose": false
|
||||
},
|
||||
"include": ["**/*.ts"],
|
||||
"include": ["**/*.ts", "**/*.mjs"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user