chore(eslint)/disable autofix for const#8760
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe ESLint configuration detects fix mode from command-line arguments, centralizes primary lint globs, and conditionally disables ChangesLint fix configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 91: Update the lint:fix script to keep eqeqeq, prefer-const, and no-var
diagnostics enabled; if their autofixes must be excluded, configure only those
fix types rather than disabling the rules via --rule.
- Line 91: Update the lint:fix npm script’s ESLint rule configuration to avoid
shell-dependent single-quote delimiters. Pass each rule through separate --rule
arguments using ESLint’s levn format, while preserving the existing eqeqeq,
prefer-const, and no-var settings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: dc577837-4acb-4ecb-84aa-ee81d72914a3
📒 Files selected for processing (1)
package.json
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@eslint.config.js`:
- Around line 99-108: Keep eqeqeq and prefer-const enabled during lint fixes so
diagnostics remain visible, while preventing their autofixes through ESLint’s
fix-type filtering or an equivalent configuration. Update eslint.config.js at
lines 99-108 to remove the rule-off override or preserve the existing rule
levels, and update package.json at line 91 to use the selected filtering
approach instead of setting ESLINT_DISABLE_AUTOFIX.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7a695050-064e-418a-9a98-c0c3d9cb5792
📒 Files selected for processing (2)
eslint.config.jspackage.json
| // When running `eslint --fix` we don't want these two rules to silently | ||
| // rewrite existing code (they still run and warn under plain `npm run lint`). | ||
| // Toggle via ESLINT_DISABLE_AUTOFIX=true, set by the `lint:fix` script. | ||
| ...(process.env.ESLINT_DISABLE_AUTOFIX === 'true' ? [{ | ||
| files: mainLintFiles, | ||
| rules: { | ||
| 'eqeqeq': 'off', | ||
| 'prefer-const': 'off' | ||
| } | ||
| }] : []), |
There was a problem hiding this comment.
Preserve diagnostics while excluding autofixes.
The environment-based contract turns rules off during lint:fix, hiding findings instead of merely preventing their fixes. Replace it with fix-type filtering or a dedicated configuration that keeps the rules enabled.
eslint.config.js#L99-L108: remove the rule-off override or preserve the rule levels.package.json#L91-L91: invokeeslint --fixusing the chosen fix-filtering approach instead of settingESLINT_DISABLE_AUTOFIX.
📍 Affects 2 files
eslint.config.js#L99-L108(this comment)package.json#L91-L91
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@eslint.config.js` around lines 99 - 108, Keep eqeqeq and prefer-const enabled
during lint fixes so diagnostics remain visible, while preventing their
autofixes through ESLint’s fix-type filtering or an equivalent configuration.
Update eslint.config.js at lines 99-108 to remove the rule-off override or
preserve the existing rule levels, and update package.json at line 91 to use the
selected filtering approach instead of setting ESLINT_DISABLE_AUTOFIX.
Co-authored-by: Sid <siddharth@usebruno.com>
Co-authored-by: Sid <siddharth@usebruno.com>
Co-authored-by: Sid <siddharth@usebruno.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@eslint.config.js`:
- Line 13: Update the arrow-function parameter in the isFixMode declaration to
use parentheses, preserving the existing argument matching and fix-mode
detection logic while conforming to the repository’s arrow-parens convention.
- Line 104: Update the override condition around the visible spread in the
ESLint configuration to apply it only when isFixMode is true, preserving normal
lint behavior while disabling the relevant prefer-const rewrite during fix runs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9ddf26e3-96d6-41d0-8c2f-25a3a67c6aa2
📒 Files selected for processing (1)
eslint.config.js
Co-authored-by: Sid <siddharth@usebruno.com>
Description
remove autofix for no var and use const
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit