Skip to content

Commit d417d05

Browse files
authored
fix: handle deprecated typeParameters (#1229)
https://typescript-eslint.io/troubleshooting/#the-key-property-is-deprecated-on-type-nodes-use-key-instead-warnings `typeParameters` are deprecated, and should use `typeArguments` instead. Allow fallback to `typeParameters` to maintain backward compatibility.
1 parent 98990e8 commit d417d05

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/utils/hasReturnValue.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ const isNewPromiseExpression = (node) => {
1919
* @returns {boolean}
2020
*/
2121
const isVoidPromise = (node) => {
22-
return /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (
23-
node
24-
)?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';
22+
return /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeArguments?.params?.[0]?.type === 'TSVoidKeyword'
23+
|| /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';
2524
};
2625

2726
const undefinedKeywords = new Set([

0 commit comments

Comments
 (0)