Skip to content

Commit

Permalink
return-await always
Browse files Browse the repository at this point in the history
  • Loading branch information
jattasNI committed Sep 26, 2024
1 parent d293fa3 commit 003b132
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ module.exports = {

// Defined by Airbnb
'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',
'@typescript-eslint/return-await': ['error', 'always'],
}
};
6 changes: 4 additions & 2 deletions tests/typescript-requiring-type-checking/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ export class NI {
this._awesomeLevel += 1;
}

public async asyncAwesomeness(): Promise<void> {
await Promise.resolve(true);
public async slowAdd(a: number, b: number, timeMs: number): Promise<number> {
return await new Promise(resolve => {
setTimeout(() => resolve(a + b), timeMs);
});
}
}

0 comments on commit 003b132

Please sign in to comment.