Skip to content

Commit 8ee7660

Browse files
ThanhDodeurOdooalexkuhn
authored andcommitted
[REF] version 1.3.2: node 22 and typescript
This commit increases the required node version to the next LTS (node 22). Since node 22.7, it is possible to have complete native (non-transpiled) TypeScript support with node.js, so this commit also updates the codebase to TypeScript.
1 parent c60a146 commit 8ee7660

40 files changed

+3847
-2977
lines changed

.eslintrc.json

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
// Based on Odoo's .eslintrc.js
22
{
3-
"extends": ["eslint:recommended", "plugin:prettier/recommended", "plugin:node/recommended"],
3+
"extends": [
4+
"eslint:recommended",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:node/recommended",
7+
"plugin:prettier/recommended"
8+
],
49
"parserOptions": {
510
"ecmaVersion": 2022,
6-
"sourceType": "module"
11+
"sourceType": "module",
12+
"project": "./tsconfig.json"
713
},
814
"env": {
915
"node": true,
1016
"browser": false,
1117
"es2022": true
1218
},
19+
"parser": "@typescript-eslint/parser",
20+
"plugins": ["@typescript-eslint"],
1321
"overrides": [
1422
{
15-
"files": ["tests/utils/*.js", "tests/*.js"],
23+
"files": ["tests/utils/*.ts", "tests/*.ts"],
1624
"plugins": ["jest", "import"],
1725
"env": {
1826
"jest": true,
@@ -21,14 +29,14 @@
2129
"extends": ["plugin:jest/recommended"]
2230
},
2331
{
24-
"files": ["src/client.js"],
32+
"files": ["src/client.ts"],
2533
"env": {
2634
"browser": true,
2735
"node": false
2836
}
2937
},
3038
{
31-
"files": ["src/shared/*.js"],
39+
"files": ["src/shared/*.ts"],
3240
"env": {
3341
"browser": true,
3442
"node": true
@@ -42,10 +50,12 @@
4250
"semi": true,
4351
"singleQuote": false,
4452
"printWidth": 100,
45-
"endOfLine": "auto"
53+
"endOfLine": "auto",
54+
"trailingComma": "none"
4655
}],
4756
"node/no-unsupported-features/es-syntax": "off",
4857
"node/no-missing-import": "off",
58+
"comma-dangle": "off",
4959
"no-console": "error",
5060
"no-undef": "error",
5161
"no-restricted-globals": ["error", "event", "self"],
@@ -58,12 +68,15 @@
5868
"no-unsafe-negation": ["error"],
5969
"no-duplicate-imports": ["error"],
6070
"valid-typeof": ["error"],
61-
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }],
71+
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }],
6272
"curly": ["error", "all"],
6373
"no-restricted-syntax": ["error", "PrivateIdentifier"],
6474
"prefer-const": ["error", {
6575
"destructuring": "all",
6676
"ignoreReadBeforeAssign": true
6777
}]
78+
},
79+
"globals": {
80+
"NodeJS": "readonly"
6881
}
6982
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The server is not stand-alone, it does not serve any HTML or any interface code
1010
the SFU and a [client bundle/library](#client-api-bundle) to connect to it.
1111

1212
## Prerequisites
13-
- [Node.js 20.9.0 (LTS)](https://nodejs.org/)
13+
- [Node.js 22.16.0 (LTS)](https://nodejs.org/en/download)
1414

1515
## Before deployment
1616

jest.config.cjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ module.exports = {
44
coverageReporters: ["text", "json-summary"],
55
openHandlesTimeout: 10000,
66
maxWorkers: 4,
7+
preset: "ts-jest",
8+
testEnvironment: "node",
9+
extensionsToTreatAsEsm: [".ts"],
710
};

0 commit comments

Comments
 (0)