Skip to content

Commit

Permalink
feat: introduce satisfies operator support
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkPurple141 committed Nov 13, 2023
1 parent 84c25de commit 099783e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/eslint-codemod-utils/lib/ts-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,15 @@ export const tsArrayType: StringableASTNodeFn<TSESTree.TSArrayType> = ({
toString: () => `${node(elementType)}[]`,
}
}

export const tsSatisfiesExpression: StringableASTNodeFn<
TSESTree.TSSatisfiesExpression
> = ({ expression, typeAnnotation, ...other }) => {
return {
...other,
expression,
typeAnnotation,
type: AST_NODE_TYPES.TSSatisfiesExpression,
toString: () => `${node(expression)} satisfies ${node(typeAnnotation)}`,
}
}

0 comments on commit 099783e

Please sign in to comment.