Skip to content

Commit

Permalink
fix: handle deprecated typeParameters (#1229)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aidvu committed May 15, 2024
1 parent 98990e8 commit d417d05
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/hasReturnValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ const isNewPromiseExpression = (node) => {
* @returns {boolean}
*/
const isVoidPromise = (node) => {
return /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (
node
)?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';
return /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeArguments?.params?.[0]?.type === 'TSVoidKeyword'
|| /** @type {import('@typescript-eslint/types').TSESTree.TSTypeReference} */ (node)?.typeParameters?.params?.[0]?.type === 'TSVoidKeyword';
};

const undefinedKeywords = new Set([
Expand Down

0 comments on commit d417d05

Please sign in to comment.