1- const { AST_NODE_TYPES , TSESTree , ESLintUtils } = require ( "@typescript-eslint/utils" ) ;
1+ const { AST_NODE_TYPES , ESLintUtils } = require ( "@typescript-eslint/utils" ) ;
22const { createRule } = require ( "./utils.cjs" ) ;
33const ts = require ( "typescript" ) ;
44
5+ /**
6+ * @typedef {import("@typescript-eslint/utils").TSESTree.CallExpression | import("@typescript-eslint/utils").TSESTree.NewExpression } CallOrNewExpression
7+ */
8+
59const unset = Symbol ( ) ;
610/**
711 * @template T
@@ -42,7 +46,7 @@ module.exports = createRule({
4246
4347 /** @type {(name: string) => boolean } */
4448 const isSetOrAssert = name => name . startsWith ( "set" ) || name . startsWith ( "assert" ) ;
45- /** @type {(node: TSESTree.Node) => boolean } */
49+ /** @type {(node: import("@typescript-eslint/utils"). TSESTree.Node) => boolean } */
4650 const isTrivia = node => {
4751 if ( node . type === AST_NODE_TYPES . Identifier ) {
4852 return node . name === "undefined" ;
@@ -56,7 +60,7 @@ module.exports = createRule({
5660 return false ;
5761 } ;
5862
59- /** @type {(node: TSESTree.CallExpression | TSESTree.NewExpression ) => boolean } */
63+ /** @type {(node: CallOrNewExpression ) => boolean } */
6064 const shouldIgnoreCalledExpression = node => {
6165 if ( node . callee && node . callee . type === AST_NODE_TYPES . MemberExpression ) {
6266 const methodName = node . callee . property . type === AST_NODE_TYPES . Identifier
@@ -97,7 +101,7 @@ module.exports = createRule({
97101 return false ;
98102 } ;
99103
100- /** @type {(node: TSESTree.Node, i: number, getSignature: () => ts.Signature | undefined) => void } */
104+ /** @type {(node: import("@typescript-eslint/utils"). TSESTree.Node, i: number, getSignature: () => ts.Signature | undefined) => void } */
101105 const checkArg = ( node , i , getSignature ) => {
102106 if ( ! isTrivia ( node ) ) {
103107 return ;
@@ -119,7 +123,7 @@ module.exports = createRule({
119123 } ) ;
120124
121125 const comments = sourceCode . getCommentsBefore ( node ) ;
122- /** @type {TSESTree.Comment | undefined } */
126+ /** @type {import("@typescript-eslint/utils"). TSESTree.Comment | undefined } */
123127 const comment = comments [ comments . length - 1 ] ;
124128
125129 if ( ! comment || comment . type !== "Block" ) {
@@ -170,7 +174,7 @@ module.exports = createRule({
170174 }
171175 } ;
172176
173- /** @type {(node: TSESTree.CallExpression | TSESTree.NewExpression ) => void } */
177+ /** @type {(node: CallOrNewExpression ) => void } */
174178 const checkArgumentTrivia = node => {
175179 if ( shouldIgnoreCalledExpression ( node ) ) {
176180 return ;
0 commit comments