Disallow unused expressions

This commit is contained in:
Stan Wohlwend 2024-07-14 10:41:20 -07:00
parent 580bd73348
commit eaa0930617
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ module.exports = {
tsconfigRootDir: process.cwd(),
},
rules: {
"no-unused-expressions": ["error", { enforceForJSX: true }],
"no-trailing-spaces": "warn",
"key-spacing": "error",
"indent": ["error", 2, {

View File

@ -236,7 +236,11 @@ export function rateLimited<T>(
);
for (const nextFunc of nextFuncs) {
value.status === "ok" ? nextFunc[0](value.data) : nextFunc[1](value.error);
if (value.status === "ok") {
nextFunc[0](value.data);
} else {
nextFunc[1](value.error);
}
}
};