|
1 | 1 | import * as eslintUtils from 'eslint-utils'; |
2 | | -import { TSESTree } from '../../ts-estree'; |
3 | 2 | import * as TSESLint from '../../ts-eslint'; |
| 3 | +import { TSESTree } from '../../ts-estree'; |
4 | 4 |
|
5 | 5 | /** |
6 | 6 | * Get the proper location of a given function node to report. |
@@ -101,19 +101,23 @@ const hasSideEffect = eslintUtils.hasSideEffect as ( |
101 | 101 | }, |
102 | 102 | ) => boolean; |
103 | 103 |
|
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 | +}; |
117 | 121 |
|
118 | 122 | export { |
119 | 123 | getFunctionHeadLocation, |
|
0 commit comments