@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
53 lines • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NamingViolation = void 0;
const ValueObject_1 = require("./ValueObject");
/**
* Represents a naming convention violation found in source code
*/
class NamingViolation extends ValueObject_1.ValueObject {
constructor(props) {
super(props);
}
static create(fileName, violationType, layer, filePath, expected, actual, suggestion) {
return new NamingViolation({
fileName,
violationType,
layer,
filePath,
expected,
actual,
suggestion,
});
}
get fileName() {
return this.props.fileName;
}
get violationType() {
return this.props.violationType;
}
get layer() {
return this.props.layer;
}
get filePath() {
return this.props.filePath;
}
get expected() {
return this.props.expected;
}
get actual() {
return this.props.actual;
}
get suggestion() {
return this.props.suggestion;
}
getMessage() {
const baseMessage = `File "${this.fileName}" in "${this.layer}" layer violates naming convention`;
if (this.suggestion) {
return `${baseMessage}. Expected: ${this.expected}. Suggestion: ${this.suggestion}`;
}
return `${baseMessage}. Expected: ${this.expected}`;
}
}
exports.NamingViolation = NamingViolation;
//# sourceMappingURL=NamingViolation.js.map