Skip to content

Commit da72a16

Browse files
committed
🚨(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.
1 parent 9a51e02 commit da72a16

File tree

7 files changed

+33
-21
lines changed

7 files changed

+33
-21
lines changed

src/frontend/servers/y-provider/.eslintrc.cjs

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

src/frontend/servers/y-provider/__tests__/collaborationResetConnections.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ describe('Server Tests', () => {
5858
expect(response.status).toBe(200);
5959
expect(response.body).toStrictEqual({ message: 'Connections reset' });
6060

61-
// eslint-disable-next-line jest/unbound-method
6261
expect(closeConnectionsMock).toHaveBeenCalledOnce();
6362
});
6463
});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig } from '@eslint/config-helpers';
2+
import docsPlugin from 'eslint-plugin-docs';
3+
4+
const eslintConfig = defineConfig([
5+
{
6+
ignores: ['dist/**'],
7+
},
8+
{
9+
files: ['**/*.mjs', '**/*.ts', '**/*.tsx'],
10+
plugins: {
11+
docs: docsPlugin,
12+
},
13+
extends: ['docs/next'],
14+
languageOptions: {
15+
parserOptions: {
16+
tsconfigRootDir: import.meta.dirname,
17+
project: ['./tsconfig.json'],
18+
},
19+
},
20+
rules: {
21+
'@next/next/no-html-link-for-pages': 'off',
22+
},
23+
},
24+
]);
25+
26+
export default eslintConfig;

src/frontend/servers/y-provider/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": "tsc -p tsconfig.build.json && tsc-alias",
1010
"dev": "cross-env COLLABORATION_LOGGING=true && nodemon --config nodemon.json",
1111
"start": "node ./dist/start-server.js",
12-
"lint": "eslint . --ext .ts",
12+
"lint": "eslint",
1313
"test": "vitest --run --disable-console-intercept"
1414
},
1515
"engines": {

src/frontend/servers/y-provider/src/servers/hocuspocusServer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,12 @@ export const hocuspocusServer = Server.configure({
7474
*/
7575
try {
7676
const user = await fetchCurrentUser(requestHeaders);
77+
7778
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
7879
context.userId = user.id;
79-
} catch {}
80+
} catch {
81+
/* empty */
82+
}
8083

8184
logger(
8285
'Connection established on room:',

src/frontend/servers/y-provider/tsconfig.build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"compilerOptions": {
44
"rootDir": "./src",
55
},
6+
"include": ["**/*.ts"],
67
"exclude": ["node_modules", "dist", "__tests__"],
78
}

src/frontend/servers/y-provider/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
"resolveFullPaths": true,
2222
"verbose": false
2323
},
24-
"include": ["**/*.ts"],
24+
"include": ["**/*.ts", "**/*.mjs"],
2525
"exclude": ["node_modules"]
2626
}

0 commit comments

Comments
 (0)