Skip to content

Commit ff0adcb

Browse files
committed
feat(cli): webjs check --rules shows enabled/disabled state per project
Reads the project's overrides via loadConventionOverrides(), then annotates each rule line as [enabled] or [disabled by override]. Header text states the default-on invariant explicitly so AI agents reading the output cannot misinterpret it. Makes the CLI the canonical way to discover the active rule set for any webjs project. Docs no longer maintain a hand-typed rule list.
1 parent 81bdf7c commit ff0adcb

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

packages/cli/bin/webjs.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,28 @@ async function main() {
191191
break;
192192
}
193193
case 'check': {
194-
const { checkConventions, RULES } = await import('@webjskit/server/check');
195-
const violations = await checkConventions(process.cwd());
194+
const { checkConventions, RULES, loadConventionOverrides } = await import('@webjskit/server/check');
196195

197196
if (rest.includes('--rules')) {
198-
console.log('webjs check, available rules:\n');
197+
const overrides = await loadConventionOverrides(process.cwd());
198+
const anyOverride = Object.keys(overrides).length > 0;
199+
console.log('webjs check, available rules:');
200+
console.log(' All rules are ENABLED by default. A rule is only off when');
201+
console.log(' package.json "webjs": { "conventions": { ... } } sets it');
202+
console.log(' to false.\n');
199203
for (const r of RULES) {
200-
console.log(` ${r.name.padEnd(30)} ${r.description}`);
204+
const off = overrides[r.name] === false;
205+
const status = off ? '[disabled by override]' : '[enabled]';
206+
console.log(` ${r.name.padEnd(30)} ${status.padEnd(24)} ${r.description}`);
207+
}
208+
if (!anyOverride) {
209+
console.log('\n (no overrides found; every rule above is active in this project)');
201210
}
202211
break;
203212
}
204213

214+
const violations = await checkConventions(process.cwd());
215+
205216
if (violations.length === 0) {
206217
console.log('webjs check: all conventions pass ✓');
207218
} else {

0 commit comments

Comments
 (0)