@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
89 lines • 2.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FILE_ENCODING = exports.CODE_PATTERNS = exports.DETECTION_KEYWORDS = exports.TREE_SITTER_NODE_TYPES = exports.GIT_DEFAULTS = exports.SINGLE_CHAR_LIMIT = exports.MIN_STRING_LENGTH = exports.CONTEXT_EXTRACT_SIZE = exports.ALLOWED_NUMBERS = exports.DEFAULT_EXTENSIONS = exports.DEFAULT_EXCLUDES = void 0;
/**
* Default file scanning options
*/
exports.DEFAULT_EXCLUDES = [
"node_modules",
"dist",
"build",
"coverage",
".git",
".puaros",
"tests",
"test",
"__tests__",
"examples",
];
exports.DEFAULT_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
/**
* Allowed numbers that are not considered magic numbers
*/
exports.ALLOWED_NUMBERS = new Set([-1, 0, 1, 2, 10, 100, 1000]);
/**
* Default context extraction size (characters)
*/
exports.CONTEXT_EXTRACT_SIZE = 30;
/**
* String length threshold for magic string detection
*/
exports.MIN_STRING_LENGTH = 3;
/**
* Single character limit for string detection
*/
exports.SINGLE_CHAR_LIMIT = 1;
/**
* Git defaults
*/
exports.GIT_DEFAULTS = {
REMOTE: "origin",
BRANCH: "main",
};
/**
* Tree-sitter node types for function detection
*/
exports.TREE_SITTER_NODE_TYPES = {
FUNCTION_DECLARATION: "function_declaration",
ARROW_FUNCTION: "arrow_function",
FUNCTION_EXPRESSION: "function_expression",
};
/**
* Detection keywords for hardcode analysis
*/
exports.DETECTION_KEYWORDS = {
TIMEOUT: "timeout",
DELAY: "delay",
RETRY: "retry",
LIMIT: "limit",
MAX: "max",
MIN: "min",
PORT: "port",
INTERVAL: "interval",
TEST: "test",
DESCRIBE: "describe",
CONSOLE_LOG: "console.log",
CONSOLE_ERROR: "console.error",
HTTP: "http",
API: "api",
};
/**
* Code patterns for detecting exported constants
*/
exports.CODE_PATTERNS = {
EXPORT_CONST: "export const ",
EXPORT: "export ",
IMPORT: "import ",
AS_CONST: " as const",
AS_CONST_OBJECT: "} as const",
AS_CONST_ARRAY: "] as const",
AS_CONST_END_SEMICOLON_OBJECT: "};",
AS_CONST_END_SEMICOLON_ARRAY: "];",
OBJECT_START: "= {",
ARRAY_START: "= [",
};
/**
* File encoding
*/
exports.FILE_ENCODING = "utf-8";
//# sourceMappingURL=defaults.js.map