feat: v4.5.0 - pivot to ESLint config translation#1
Merged
Conversation
New CLI command `ruleprobe lint-config <input.md>` that parses an instruction file and emits a working ESLint config (flat config by default, --format=legacy for .eslintrc style). Adds: - src/mapper/: maps RuleProbe RuleSet to EslintConfig structure - src/mapper/mappings/: 13 mapping files covering all mappable rule types - src/emitter/eslint.ts: serializes EslintConfig to runnable config - src/cli/lint-config.ts: wired into commander setup Mappable rules (with ESLint equivalents): - no-any -> @typescript-eslint/no-explicit-any - named-exports -> import/no-default-export - kebab-case-files -> unicorn/filename-case - max-lines -> max-lines - max-line-length -> max-len - no-console -> no-console - jsdoc-required -> jsdoc/require-jsdoc - pascalcase-types + camelcase-vars -> @typescript-eslint/naming-convention - no-var, prefer-const, no-empty-catch, no-enum, no-type-assertions, no-non-null-assertions, no-nested-ternary, no-magic-numbers, max-lines-per-function, max-params, no-throw-literal, no-else-after-return, consistent-semicolons, quote-style, no-wildcard-exports, no-namespace-imports, no-ts-directives, no-implicit-any, no-unused-vars, no-todo-comments Unmappable rules emit as commented sections with original instruction text and a one-line reason (e.g. strict-mode -> tsconfig, not ESLint). Tests: 42 new (34 mapper unit, 8 emitter, 5 e2e, 5 CLI integration). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add src/action/ module with TypeScript action entry point: - detect-changes: skip drift when only unrelated files changed - comment: format drift results as PR comments with dedup marker - regenerate: open follow-up PRs with regenerated config - runner: orchestrate drift/verify modes with injectable deps - main: parse env vars and delegate to runner Tests: 65 new tests across detect-changes (31), comment (12), regenerate (9), and runner (13) with mock GitHub payloads. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- action.yml: default mode is now drift, not verify. New inputs: eslint-file, regenerate-on-drift, comment-on-pr, fail-on-drift, mode. Verify mode preserved under mode: verify with legacy inputs. Drift step runs via node dist/action/main.js; verify step still uses action-scripts/run-verify.sh. - README: drift-first action example, document new inputs, move verify mode under "legacy" subsection, add monorepo limitation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pivot RuleProbe from "verify adherence" to "translate instruction files into ESLint configs." Three new commands: lint-config, drift, extract. Remove compare, tasks, task, and run commands. Audit parser matchers down to 34 ESLint-mappable matchers (from ~103). Remove 67 unmappable matchers and 7 empty categories. BREAKING: compare, tasks, task, and run commands removed. BREAKING: runner module removed from public API. BREAKING: formatComparisonMarkdown removed from reporter. BREAKING: RuleCategory narrowed to 7 categories + agent-behavior. BREAKING: VerifierType narrowed to ast, regex, filesystem. BREAKING: verify command deprecated (still works, primary focus shifted). - Remove src/commands/compare.ts, tasks.ts, run.ts - Remove src/runner/agent-configs.ts, agent-invoker.ts, watch-mode.ts, task-templates.ts, task-templates/*.md - Remove 6 matcher files: preference, file-structure, tooling, testing, config-file, git-history - Remove individual unmappable matchers from remaining files - Add src/commands/drift.ts, extract.ts (from prior commits) - Add src/drift/, src/extractor/, src/mappings/ (from prior commits) - Rewrite README around translate/drift/extract pitch - Add CHANGELOG v4.5.0 entry - Bump package.json to 4.5.0 - Update .npmignore and .gitignore for dev artifacts - Update all test files for removed matchers and commands - Clean stale dist files Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
P0: Generated ESLint configs are invalid
- Flat config: rule entries use object property syntax with quoted
severity strings; plugin keys with special chars are quoted;
plugins registered in plugins object
- Legacy config: output is valid JSON via JSON.stringify(); unmappable
rules appear as comment block after JSON
- Added tests that parse generated configs and validate syntax
P0: Unsupported parser rules become false passes
- All CATEGORY_MAP entries set to null; unmatched categories go to
unparseable instead of creating generic rules
- Verifiers return {passed: false, skipped: true} for unsupported
pattern types instead of silently passing
- Added skipped field to RuleResult type
P0: Drift and extract async config parsing
- parseEslintConfigAsync() supports .js, .mjs, .cjs, .ts files
- drift.ts and extract.ts now use async parser
- Synchronous parser throws for JS/TS files with actionable message
- Added resolveSafePath() to lint-config, drift, and extract commands
P0: GitHub Action drift mode broken
- Added RULEPROBE_BIN env var for resolved CLI path
- Made findEslintFileInWorkspace() async with proper await
- Both drift and verify steps in action.yml set RULEPROBE_BIN
P1: ESLint rule mapping accuracy
- no-wildcard-exports: import/no-namespace -> import/no-anonymous-default-export
- no-namespace-imports: @typescript-eslint/consistent-type-imports -> import/no-namespace
- no-unused-exports: no-unused-vars -> import/no-unused-modules
- no-implicit-any: @typescript-eslint/no-implicit-any -> @typescript-eslint/no-explicit-any
- no-deep-relative-imports: now includes maxDepth in options
P1: Package output contains stale build artifacts
- Added prebuild script (rm -rf dist) to clean before every build
- Added files allowlist to package.json
P1: README and reference docs stale
- Updated README format descriptions and verify format list
- Removed removed commands (compare, tasks, task, run) from cli-reference.md
- Added lint-config, drift, extract command docs
- Updated matchers.md to reflect 34 mappable matchers across 7 categories
P2: Path boundary and config validation
- resolveSafePath() applied to lint-config, drift, and extract
- Config validation now rejects unknown categories and verifiers
- verify command accepts all valid report formats (summary, detailed, ci added)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The self-check workflow defaulted to drift mode, which requires an ESLint config file that doesn't exist in this repo. Switch to verify mode which only needs the instruction file and source directory. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lint-config,drift,extract.compare,tasks,task, andruncommands and all runner/agent-invocation code.Breaking changes
compare,tasks,task,runcommands removedbuildAgentConfig,invokeAgent,watchForCompletion,countCodeFiles) removed from public APIformatComparisonMarkdownremoved from reporterRuleCategorynarrowed: removedtest-requirement,dependency,preference,file-structure,tooling,testing,workflowVerifierTypenarrowed: removedtreesitter,preference,tooling,config-file,git-historyverifycommand deprecated (still works)Test plan
npm run buildpassesruleprobe lint-config CLAUDE.mdproduces valid ESLint configruleprobe drift CLAUDE.md <eslint-config>detects driftruleprobe extract <eslint-config>produces markdown rules sectionnpm pack --dry-runtarball contains expected files, no dev artifacts🤖 Generated with Claude Code