UNPKG

eslint-plugin-perfectionist

Version:

ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.

16 lines (15 loc) 547 B
'use strict' Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }) let isNodeFunctionType = node => { if (node.type === 'TSMethodSignature' || node.type === 'TSFunctionType') { return true } if (node.type === 'TSUnionType' || node.type === 'TSIntersectionType') { return node.types.every(isNodeFunctionType) } if (node.type === 'TSPropertySignature' && node.typeAnnotation) { return isNodeFunctionType(node.typeAnnotation.typeAnnotation) } return false } exports.isNodeFunctionType = isNodeFunctionType