eslint-plugin-perfectionist
Version:
ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
16 lines (15 loc) • 475 B
JavaScript
import { AST_NODE_TYPES } from '@typescript-eslint/utils'
/**
* Checks whether a node is a PropertyDefinition or AccessorProperty.
*
* @param node - The AST node to check.
* @returns True if the node is a PropertyDefinition or AccessorProperty, false
* otherwise.
*/
function isPropertyOrAccessorNode(node) {
return (
node.type === AST_NODE_TYPES.PropertyDefinition ||
node.type === AST_NODE_TYPES.AccessorProperty
)
}
export { isPropertyOrAccessorNode }