Repository navigation
fix: eslint-plugin v1.0.3 - ignore config errors for unsupported file types - #55
Conversation
… types (v1.0.3) ESLint returns exit code 1 for both real lint violations and configuration failures (e.g. parsing .md files not supported by the project's ESLint config). Previously the hook would block Claude on all exit code 1 cases, even for non-actionable errors like "Parsing error: ESLint was configured to run on .md". Now when ESLint exits with code 1, the hook checks whether any errors appear at actual line numbers (>0). Configuration failures always appear at line 0:0 and are silently ignored. Only real code rule violations at non-zero lines block the agent. Bumps plugin version from 1.0.2 to 1.0.3. Fixes #54 Co-authored-by: Eli Oshinsky <eli0shin@users.noreply.github.com>
Code ReviewSummaryThis is a sensible fix for a real usability problem — ESLint's exit code 1 conflation between config errors and actual rule violations was causing unnecessary blocks. The approach is consistent with the existing pattern of string-matching guards already in the file. Issues & Suggestions1. Control flow clarity (minor)The fall-through after the early 2. Regex is coupled to ESLint's default text formatterThe pattern A more robust approach would be to force JSON output for the check and parse 3. Regex could match error descriptions, not just location markersA message like 4. Silent failure gives no feedbackWhen ignoring a config error, the hook returns 5. No test coverageThe project has a test suite (
VerdictThe fix correctly solves the reported issue (#54). The regex-based approach is pragmatic and consistent with the file's existing style. Main suggestions:
Good work identifying the root cause (exit code 1 is overloaded by ESLint) and explaining it clearly in the PR description. |
ESLint returns exit code 1 for both real lint violations and configuration failures (e.g. parsing .md files not supported by the project's ESLint config). Previously the hook would block Claude on all exit code 1 cases, even for non-actionable errors like "Parsing error: ESLint was configured to run on .md".
Now when ESLint exits with code 1, the hook checks whether any errors appear at actual line numbers (>0). Configuration failures always appear at line 0:0 and are silently ignored. Only real code rule violations at non-zero lines block the agent.
Bumps plugin version from 1.0.2 to 1.0.3.
Fixes #54
Generated with Claude Code