Skip to content

chore(eslint)/disable autofix for const#8760

Open
sachin-thakur-bruno wants to merge 6 commits into
usebruno:mainfrom
sachin-thakur-bruno:chore/lint-autofix
Open

chore(eslint)/disable autofix for const#8760
sachin-thakur-bruno wants to merge 6 commits into
usebruno:mainfrom
sachin-thakur-bruno:chore/lint-autofix

Conversation

@sachin-thakur-bruno

@sachin-thakur-bruno sachin-thakur-bruno commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Description

remove autofix for no var and use const

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

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

  • Chores
    • Updated linting behavior for fix and dry-run modes.
    • Centralized the primary linting file targets for more consistent checks.
    • Adjusted selected lint rules during automatic fixes to support smoother formatting workflows.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b145abe8-4175-4caa-8557-fce9fad38e26

📥 Commits

Reviewing files that changed from the base of the PR and between 2f04953 and 69e529a.

📒 Files selected for processing (1)
  • eslint.config.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • eslint.config.js

Walkthrough

The ESLint configuration detects fix mode from command-line arguments, centralizes primary lint globs, and conditionally disables eqeqeq and prefer-const for those targets during fix operations.

Changes

Lint fix configuration

Layer / File(s) Summary
Update lint:fix rule overrides
eslint.config.js
Detects --fix and --fix-dry-run, reuses shared lint targets, and conditionally disables eqeqeq and prefer-const during fix mode.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: bijin-bruno, helloanoop

Poem

Fix mode wakes with flags aglow,
Shared lint paths begin to flow.
Two rules rest while changes spin,
Cleaner configs let fixes win.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: disabling ESLint autofix behavior related to const/var conversion.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8496be1 and c8497a6.

📒 Files selected for processing (1)
  • package.json

Comment thread package.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c8497a6 and c143259.

📒 Files selected for processing (2)
  • eslint.config.js
  • package.json

Comment thread eslint.config.js
Comment on lines +99 to +108
// 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'
}
}] : []),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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: invoke eslint --fix using the chosen fix-filtering approach instead of setting ESLINT_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.

sid-bruno
sid-bruno previously approved these changes Jul 24, 2026
Comment thread eslint.config.js
Comment thread eslint.config.js Outdated
Comment thread package.json Outdated
Co-authored-by: Sid <siddharth@usebruno.com>
sachin-thakur-bruno and others added 2 commits July 24, 2026 15:38
Co-authored-by: Sid <siddharth@usebruno.com>
Co-authored-by: Sid <siddharth@usebruno.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c143259 and 2f04953.

📒 Files selected for processing (1)
  • eslint.config.js

Comment thread eslint.config.js
Comment thread eslint.config.js Outdated
Comment thread eslint.config.js Outdated
Co-authored-by: Sid <siddharth@usebruno.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants