Skip to content

Commit 806eaac

Browse files
authored
fix(experimental-utils): add missing signature for isParenthesized (typescript-eslint#3887)
1 parent ed5e459 commit 806eaac

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

packages/experimental-utils/src/ast-utils/eslint-utils/astUtilities.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as eslintUtils from 'eslint-utils';
2-
import { TSESTree } from '../../ts-estree';
32
import * as TSESLint from '../../ts-eslint';
3+
import { TSESTree } from '../../ts-estree';
44

55
/**
66
* Get the proper location of a given function node to report.
@@ -101,19 +101,23 @@ const hasSideEffect = eslintUtils.hasSideEffect as (
101101
},
102102
) => boolean;
103103

104-
/**
105-
* Check whether a given node is parenthesized or not.
106-
* This function detects it correctly even if it's parenthesized by specific syntax.
107-
*
108-
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized}
109-
* @returns `true` if the node is parenthesized.
110-
* If `times` was given, it returns `true` only if the node is parenthesized the `times` times.
111-
* For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.
112-
*/
113-
const isParenthesized = eslintUtils.isParenthesized as (
114-
node: TSESTree.Node,
115-
sourceCode: TSESLint.SourceCode,
116-
) => boolean;
104+
const isParenthesized = eslintUtils.isParenthesized as {
105+
/**
106+
* Check whether a given node is parenthesized or not.
107+
* This function detects it correctly even if it's parenthesized by specific syntax.
108+
*
109+
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized}
110+
* @returns `true` if the node is parenthesized.
111+
* If `times` was given, it returns `true` only if the node is parenthesized the `times` times.
112+
* For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.
113+
*/
114+
(node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
115+
(
116+
times: number,
117+
node: TSESTree.Node,
118+
sourceCode: TSESLint.SourceCode,
119+
): boolean;
120+
};
117121

118122
export {
119123
getFunctionHeadLocation,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy