Skip to content

feat: add 5 conservative analysis rules#39

Merged
wai-coding merged 1 commit into
mainfrom
dev
Mar 11, 2026
Merged

feat: add 5 conservative analysis rules#39
wai-coding merged 1 commit into
mainfrom
dev

Conversation

@wai-coding

Copy link
Copy Markdown
Owner

Summary

Adds 5 new conservative analysis rules to expand InspectoRepo's coverage to 14 built-in rules.

New Rules

  • no-console (warn): Detects console.log/warn/error/info/debug calls left in production code
  • no-empty-function (info): Flags empty function bodies (skips functions with intentional comments)
  • duplicate-imports (info): Detects multiple import declarations from the same module
  • no-unreachable-after-return (warn): Flags unreachable code after return/throw/break/continue statements
  • no-throw-literal (warn): Detects throwing literal values instead of Error objects

Changes

  • Created 5 new rule files in packages/core/src/rules/
  • Registered all 5 rules in config defaults, all 4 presets (recommended, strict, cleanup, react), and rule registry
  • Updated strict preset to elevate no-console, no-unreachable-after-return, and no-throw-literal to error severity
  • Added 20 new tests covering all new rules (194 total tests passing)
  • Updated export workflow Known Limitations and ROADMAP for new rules
  • Updated README with new rules tables, configuration examples, preset descriptions, and V3 roadmap
  • Updated CHANGELOG with v6 entry

Checks

  • TypeScript: clean
  • ESLint: clean
  • Build: all packages + web app successful
  • Tests: 194 passed (13 test files)

…n, duplicate-imports, no-unreachable-after-return, no-throw-literal)

- Added no-console rule: detects console.log/warn/error/info/debug calls
- Added no-empty-function rule: flags empty function bodies (skips commented stubs)
- Added duplicate-imports rule: detects multiple imports from same module
- Added no-unreachable-after-return rule: flags unreachable code after return/throw/break/continue
- Added no-throw-literal rule: detects throwing literals instead of Error objects
- Registered all 5 rules in config defaults, all 4 presets, and rule registry
- Updated strict preset to elevate no-console, no-unreachable-after-return, no-throw-literal to error
- Added 20 new tests (194 total), updated config test ALL_RULE_IDS
- Updated export workflow Known Limitations and ROADMAP
- Updated README rules tables, config example, preset descriptions, roadmap
- Updated CHANGELOG with v6 entry
@wai-coding wai-coding merged commit 51a91c2 into main Mar 11, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🔍 InspectoRepo Analysis

Metric Value
Score 0/100
Total Issues 67
🔴 Errors 2
🟡 Warnings 54
🔵 Info 11

📦 Package Highlights

Package Score Issues
⚠️ apps/web 74/100 6
🔴 packages/cli 0/100 40
🔴 packages/core 16/100 18
✅ packages/vscode-extension 83/100 3

🏷️ Top Rules by Issue Count

  • no-console — 31 issue(s)
  • complexity-hotspot — 20 issue(s)
  • duplicate-imports — 6 issue(s)

Top affected package: packages/cli (40 issues)

Full report available as a workflow artifact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant