Skip to content

Commit 8b8ddbd

Browse files
authored
Typesafe error propagation in signal connection path (#1747)
1 parent de8e54a commit 8b8ddbd

19 files changed

+1116
-684
lines changed

.changeset/early-numbers-build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-client": patch
3+
---
4+
5+
Typesafe error propagation in signal connection path

eslint.config.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import js from '@eslint/js';
33
import { configs, plugins, rules } from 'eslint-config-airbnb-extended';
44
import { rules as prettierConfigRules } from 'eslint-config-prettier';
5+
import neverthrowMustUse from 'eslint-plugin-neverthrow-must-use';
56
import prettierPlugin from 'eslint-plugin-prettier';
67

78
const strictness = 'off';
@@ -31,6 +32,15 @@ const typescriptConfig = [
3132
rules.typescript.typescriptEslintStrict,
3233
];
3334

35+
const neverthrowConfig = [
36+
{
37+
name: 'neverthrow-must-use',
38+
plugins: {
39+
'neverthrow-must-use': neverthrowMustUse,
40+
},
41+
},
42+
];
43+
3444
const prettierConfig = [
3545
// Prettier Plugin
3646
{
@@ -56,6 +66,7 @@ export default [
5666
...typescriptConfig,
5767
// Prettier Config
5868
...prettierConfig,
69+
...neverthrowConfig,
5970
{
6071
languageOptions: {
6172
parserOptions: {
@@ -158,6 +169,7 @@ export default [
158169
'one-var': strictness,
159170
'no-multi-assign': strictness,
160171
'new-cap': strictness,
172+
'require-yield': strictness,
161173

162174
radix: strictness,
163175
eqeqeq: strictness,

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"events": "^3.3.0",
6161
"jose": "^6.1.0",
6262
"loglevel": "^1.9.2",
63+
"neverthrow": "^8.2.0",
6364
"sdp-transform": "^2.15.0",
6465
"ts-debounce": "^4.0.0",
6566
"tslib": "2.8.1",
@@ -96,6 +97,7 @@
9697
"eslint-config-prettier": "10.1.8",
9798
"eslint-plugin-compat": "^6.0.2",
9899
"eslint-plugin-import-x": "^4.16.1",
100+
"eslint-plugin-neverthrow-must-use": "^0.1.2",
99101
"eslint-plugin-prettier": "^5.5.4",
100102
"gh-pages": "6.3.0",
101103
"happy-dom": "^17.2.0",

pnpm-lock.yaml

Lines changed: 30 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)