🚨(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:
Anthony LC
2025-08-07 17:05:14 +02:00
parent 9a51e02cd7
commit da72a1601a
7 changed files with 33 additions and 21 deletions

View File

@@ -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'],
};

View File

@@ -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();
});
});

View 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;

View File

@@ -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": {

View File

@@ -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:',

View File

@@ -3,5 +3,6 @@
"compilerOptions": {
"rootDir": "./src",
},
"include": ["**/*.ts"],
"exclude": ["node_modules", "dist", "__tests__"],
}

View File

@@ -21,6 +21,6 @@
"resolveFullPaths": true,
"verbose": false
},
"include": ["**/*.ts"],
"include": ["**/*.ts", "**/*.mjs"],
"exclude": ["node_modules"]
}