Skip to content

Commit 3be81a1

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 15c7d76 commit 3be81a1

File tree

7 files changed

+27
-20
lines changed

7 files changed

+27
-20
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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { defineConfig } from '@eslint/config-helpers';
2+
import docsPlugin from 'eslint-plugin-docs';
3+
4+
const eslintConfig = defineConfig([
5+
{
6+
files: ['**/*.mjs', '**/*.ts', '**/*.tsx'],
7+
plugins: {
8+
docs: docsPlugin,
9+
},
10+
extends: ['docs/next'],
11+
languageOptions: {
12+
parserOptions: {
13+
tsconfigRootDir: import.meta.dirname,
14+
project: ['./tsconfig.json'],
15+
},
16+
},
17+
rules: {
18+
'@next/next/no-html-link-for-pages': 'off',
19+
},
20+
},
21+
]);
22+
23+
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"
1414
},
1515
"engines": {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ 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;
7980
} catch {}

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)