mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
Add @puaros/guardian package v0.1.0 - code quality guardian for vibe coders and enterprise teams. Features: - Hardcode detection (magic numbers, magic strings) - Circular dependency detection - Naming convention enforcement (Clean Architecture) - Architecture violation detection - CLI tool with comprehensive reporting - 159 tests with 80%+ coverage - Smart suggestions for fixes - Built for AI-assisted development Built with Clean Architecture and DDD principles. Works with Claude, GPT, Copilot, Cursor, and any AI coding assistant.
39 lines
914 B
TypeScript
39 lines
914 B
TypeScript
// Test fixture for exported constants detection
|
|
|
|
// Single-line export const with as const
|
|
export const SINGLE_LINE_OBJECT = { value: 123 } as const
|
|
export const SINGLE_LINE_ARRAY = [1, 2, 3] as const
|
|
export const SINGLE_LINE_NUMBER = 999 as const
|
|
export const SINGLE_LINE_STRING = "test" as const
|
|
|
|
// Multi-line export const with as const
|
|
export const MULTI_LINE_CONFIG = {
|
|
timeout: 5000,
|
|
port: 8080,
|
|
retries: 3,
|
|
} as const
|
|
|
|
export const NESTED_CONFIG = {
|
|
api: {
|
|
baseUrl: "http://localhost",
|
|
timeout: 10000,
|
|
},
|
|
db: {
|
|
host: "localhost",
|
|
port: 5432,
|
|
},
|
|
} as const
|
|
|
|
// Array with as const
|
|
export const ALLOWED_PORTS = [3000, 8080, 9000] as const
|
|
|
|
// Without as const (should still be detected as hardcode)
|
|
export const NOT_CONST = {
|
|
value: 777,
|
|
}
|
|
|
|
// Regular variable (not exported) - should detect hardcode
|
|
const localConfig = {
|
|
timeout: 4000,
|
|
}
|