Skip to content

Commit

Permalink
Disallow unused expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
N2D4 committed Jul 14, 2024
1 parent 580bd73 commit eaa0930
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions eslint-configs/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
6 changes: 5 additions & 1 deletion packages/stack-shared/src/utils/promises.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
};

Expand Down

0 comments on commit eaa0930

Please sign in to comment.