@samiyev/guardian
Version:
Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W
129 lines • 3.46 kB
JavaScript
;
/**
* Abstract Syntax Tree (AST) node type constants
*
* These constants represent tree-sitter AST node types used for code analysis.
* Using constants instead of magic strings improves maintainability and prevents typos.
*
* @see https://tree-sitter.github.io/tree-sitter/
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.VALUE_PATTERN_TYPES = exports.TIMER_FUNCTIONS = exports.AST_STRING_TYPES = exports.AST_FIELD_NAMES = exports.AST_IDENTIFIER_TYPES = exports.AST_MODIFIER_TYPES = exports.AST_PATTERN_TYPES = exports.AST_FIELD_TYPES = exports.AST_EXPRESSION_TYPES = exports.AST_STATEMENT_TYPES = exports.AST_TYPE_TYPES = exports.AST_VARIABLE_TYPES = exports.AST_FUNCTION_TYPES = exports.AST_CLASS_TYPES = void 0;
/**
* Class and interface declaration node types
*/
exports.AST_CLASS_TYPES = {
CLASS_DECLARATION: "class_declaration",
INTERFACE_DECLARATION: "interface_declaration",
};
/**
* Function and method node types
*/
exports.AST_FUNCTION_TYPES = {
FUNCTION_DECLARATION: "function_declaration",
METHOD_DEFINITION: "method_definition",
FUNCTION_SIGNATURE: "function_signature",
};
/**
* Variable and parameter node types
*/
exports.AST_VARIABLE_TYPES = {
VARIABLE_DECLARATOR: "variable_declarator",
REQUIRED_PARAMETER: "required_parameter",
OPTIONAL_PARAMETER: "optional_parameter",
PUBLIC_FIELD_DEFINITION: "public_field_definition",
PROPERTY_SIGNATURE: "property_signature",
};
/**
* Type system node types
*/
exports.AST_TYPE_TYPES = {
TYPE_ALIAS_DECLARATION: "type_alias_declaration",
UNION_TYPE: "union_type",
LITERAL_TYPE: "literal_type",
TYPE_ANNOTATION: "type_annotation",
};
/**
* Statement node types
*/
exports.AST_STATEMENT_TYPES = {
EXPORT_STATEMENT: "export_statement",
IMPORT_STATEMENT: "import_statement",
LEXICAL_DECLARATION: "lexical_declaration",
};
/**
* Expression node types
*/
exports.AST_EXPRESSION_TYPES = {
CALL_EXPRESSION: "call_expression",
AS_EXPRESSION: "as_expression",
};
/**
* Field and property node types
*/
exports.AST_FIELD_TYPES = {
FIELD_DEFINITION: "field_definition",
};
/**
* Pattern node types
*/
exports.AST_PATTERN_TYPES = {
OBJECT_PATTERN: "object_pattern",
ARRAY_PATTERN: "array_pattern",
};
/**
* Modifier node types
*/
exports.AST_MODIFIER_TYPES = {
READONLY: "readonly",
STATIC: "static",
CONST: "const",
};
/**
* Special identifier node types
*/
exports.AST_IDENTIFIER_TYPES = {
IDENTIFIER: "identifier",
TYPE_IDENTIFIER: "type_identifier",
PROPERTY_IDENTIFIER: "property_identifier",
IMPORT: "import",
};
/**
* Node field names used with childForFieldName()
*/
exports.AST_FIELD_NAMES = {
NAME: "name",
DECLARATION: "declaration",
VALUE: "value",
FUNCTION: "function",
};
/**
* String fragment node type
*/
exports.AST_STRING_TYPES = {
STRING_FRAGMENT: "string_fragment",
};
/**
* Common JavaScript timer functions
*/
exports.TIMER_FUNCTIONS = {
SET_TIMEOUT: "setTimeout",
SET_INTERVAL: "setInterval",
};
/**
* Value pattern types for pattern matching
*/
exports.VALUE_PATTERN_TYPES = {
EMAIL: "email",
API_KEY: "api_key",
URL: "url",
IP_ADDRESS: "ip_address",
FILE_PATH: "file_path",
DATE: "date",
UUID: "uuid",
VERSION: "version",
JWT: "jwt",
MAC_ADDRESS: "mac_address",
BASE64: "base64",
};
//# sourceMappingURL=ast-node-types.js.map