Skip to content

Commit

Permalink
fix(experimental-utils): add missing signature for isParenthesized (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelss95 committed Sep 20, 2021
1 parent ed5e459 commit 806eaac
Showing 1 changed file with 18 additions and 14 deletions.
@@ -1,6 +1,6 @@
import * as eslintUtils from 'eslint-utils';
import { TSESTree } from '../../ts-estree';
import * as TSESLint from '../../ts-eslint';
import { TSESTree } from '../../ts-estree';

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

/**
* Check whether a given node is parenthesized or not.
* This function detects it correctly even if it's parenthesized by specific syntax.
*
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized}
* @returns `true` if the node is parenthesized.
* If `times` was given, it returns `true` only if the node is parenthesized the `times` times.
* For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.
*/
const isParenthesized = eslintUtils.isParenthesized as (
node: TSESTree.Node,
sourceCode: TSESLint.SourceCode,
) => boolean;
const isParenthesized = eslintUtils.isParenthesized as {
/**
* Check whether a given node is parenthesized or not.
* This function detects it correctly even if it's parenthesized by specific syntax.
*
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#isparenthesized}
* @returns `true` if the node is parenthesized.
* If `times` was given, it returns `true` only if the node is parenthesized the `times` times.
* For example, `isParenthesized(2, node, sourceCode)` returns true for `((foo))`, but not for `(foo)`.
*/
(node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
(
times: number,
node: TSESTree.Node,
sourceCode: TSESLint.SourceCode,
): boolean;
};

export {
getFunctionHeadLocation,
Expand Down

0 comments on commit 806eaac

Please sign in to comment.