UNPKG

tslint-react-hooks

Version:

TSLint rule that enforces the Rules of Hooks

11 lines (10 loc) • 529 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isReactComponentDecorator = void 0; const is_react_api_expression_1 = require("./is-react-api-expression"); const reactComponentDecorators = ['forwardRef', 'memo']; /** * Tests is an expression is a React top-level API component decorator (e.g. `React.forwardRef`, * `React.memo`) */ exports.isReactComponentDecorator = (0, is_react_api_expression_1.isReactApiExpression)((identifier) => reactComponentDecorators.includes(identifier.text));