@felixgeelhaar/cclint
Version:
Catch CLAUDE.md drift before Claude misbehaves. Lints CLAUDE.md, skills, subagents, and hooks for Claude Code projects.
84 lines • 2.37 kB
JavaScript
import { Severity } from './Severity.js';
export const defaultConfig = {
rules: {
'file-size': {
enabled: true,
severity: 'warning',
options: {
maxSize: 10000,
},
},
structure: {
enabled: true,
severity: 'warning',
options: {
requiredSections: [
'Project Overview',
'Development Commands',
'Architecture',
],
},
},
content: {
enabled: true,
severity: 'warning',
options: {
requiredPatterns: ['npm', 'TypeScript', 'test', 'build'],
},
},
format: {
enabled: true,
severity: 'error',
},
'code-blocks': {
enabled: true,
severity: 'warning',
options: {
languages: [
'javascript',
'typescript',
'python',
'go',
'bash',
'sql',
'yaml',
'json',
],
strict: true,
},
},
'skill-structure': {
enabled: true,
severity: 'error',
},
'subagent-structure': {
enabled: true,
severity: 'error',
},
'hook-configuration': {
enabled: true,
severity: 'warning',
},
},
ignore: [],
};
/**
* Build the per-rule severity overrides the engine applies, from a resolved
* config. A rule with a configured `severity` has all its violations emitted
* at that level (the standard linter model). Shared by every entry point so
* `config.rules.<id>.severity` behaves identically via CLI, MCP, and Action.
*/
export function buildSeverityOverrides(config) {
const overrides = new Map();
for (const [ruleId, ruleConfig] of Object.entries(config.rules)) {
const name = ruleConfig?.severity;
if (name) {
const severity = Severity.fromName(name);
if (severity) {
overrides.set(ruleId, severity);
}
}
}
return overrides;
}
//# sourceMappingURL=Config.js.map