mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-28 07:16:53 +05:00
feat(guardian): add guardian package - code quality analyzer
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.
This commit is contained in:
38
packages/guardian/tests/fixtures/code-samples/exported-constants.ts
vendored
Normal file
38
packages/guardian/tests/fixtures/code-samples/exported-constants.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// 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,
|
||||
}
|
||||
Reference in New Issue
Block a user