Skip to content

Eslint imports#2021

Open
prxt6529 wants to merge 6 commits intomainfrom
eslint-imports
Open

Eslint imports#2021
prxt6529 wants to merge 6 commits intomainfrom
eslint-imports

Conversation

@prxt6529
Copy link
Copy Markdown
Collaborator

@prxt6529 prxt6529 commented Mar 2, 2026

Summary by CodeRabbit

  • Chores
    • Refactored ESLint configuration system to support flexible configuration building.
    • Added new quality assurance and audit scripts for streamlined code review processes.
    • Updated Sentry error tracking dependency to latest version for improved monitoring.

prxt6529 added 4 commits March 2, 2026 10:53
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

Warning

Rate limit exceeded

@prxt6529 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a109f44 and d4ac851.

📒 Files selected for processing (2)
  • eslint.config.mjs
  • package.json
📝 Walkthrough

Walkthrough

The PR refactors ESLint configuration files to use a factory-based createEslintConfig() approach instead of static configuration blocks, exports new base configuration constants (basePlugins, baseRules), and updates package.json with new lint, format, quality, and audit scripts alongside a dependency version bump.

Changes

Cohort / File(s) Summary
ESLint Config Refactoring
eslint.config.mjs, eslint.config.tight.mjs
Introduces createEslintConfig() factory function for dynamic config construction; exports basePlugins and baseRules constants; refactors static configuration into modular, overridable structure with new options (rulesOverride, extraPlugins, additionalConfigs); adds error handling for react-compiler plugin loading; changes default export pattern.
Package Scripts and Dependencies
package.json
Adds new scripts for quality checks and auditing (quality:changed, quality:cr:changed, audit variants); updates lint/format scripts with xargs (-r) flag and diffing logic (main...HEAD vs HEAD); bumps @sentry/nextjs from ^10.27.0 to ^10.40.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Config updates #1701 — Both PRs modify package.json scripting for formatting/linting workflows (format:changed, format:uncommitted patterns).
  • Clean package json scripts #1686 — Both PRs update package.json scripts and may involve lint/format/quality command consolidation.

Suggested reviewers

  • ragnep

Poem

🐰 Configs once rigid, now they flow,
Factory patterns steal the show,
Base rules exported, clean and bright,
Scripts refined with xargs' might,
Sentry updated, guards airtight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Eslint imports' is vague and does not clearly convey the scope of changes, which involve a major refactor of ESLint configuration with new factory-based exports, public API changes, and script modifications. Clarify the title to reflect the main changes, such as 'Refactor ESLint config to use factory-based builder' or 'Extract basePlugins and baseRules as public exports' to better describe the architectural changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch eslint-imports

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 and usage tips.

Signed-off-by: prxt6529 <prxt@6529.io>
@prxt6529
Copy link
Copy Markdown
Collaborator Author

prxt6529 commented Mar 2, 2026

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
eslint.config.mjs (1)

46-60: Freeze exported base config objects to prevent accidental mutation.

basePlugins and baseRules are exported mutable objects. A downstream import can mutate them and change behavior for all createEslintConfig() callers. Consider freezing (or deep-cloning before merge) to keep config composition deterministic.

♻️ Proposed change
-export const basePlugins = {
+export const basePlugins = Object.freeze({
   "unused-imports": unusedImports,
   "react-hooks": reactHooks,
   "@typescript-eslint": tseslint.plugin,
   import: importPlugin,
   sonarjs: sonarjs,
   security: security,
   promise: promise,
   tailwindcss: tailwindcss,
-};
+});

-export const baseRules = {
+export const baseRules = Object.freeze({
   // ...
-};
+});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@eslint.config.mjs` around lines 46 - 60, Exported config objects basePlugins
and baseRules are mutable and should be frozen (or deep-cloned when composing)
to prevent downstream mutation; change the export to freeze these objects (e.g.
use Object.freeze on basePlugins and baseRules) or ensure createEslintConfig()
always works on a defensive deep clone of these symbols so the exported
basePlugins and baseRules remain immutable and composition is deterministic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 32-42: The npm scripts lint:changed:fix, lint:changed,
lint:changed:tight, lint:uncommitted:tight, lint:diff, format:changed and
format:uncommitted use xargs with the BSD-incompatible -r flag; remove the -r
option from each xargs invocation in those scripts so they work on macOS/BSD
(leave the rest of the bash -lc command unchanged).

---

Nitpick comments:
In `@eslint.config.mjs`:
- Around line 46-60: Exported config objects basePlugins and baseRules are
mutable and should be frozen (or deep-cloned when composing) to prevent
downstream mutation; change the export to freeze these objects (e.g. use
Object.freeze on basePlugins and baseRules) or ensure createEslintConfig()
always works on a defensive deep clone of these symbols so the exported
basePlugins and baseRules remain immutable and composition is deterministic.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46e2cc8 and a109f44.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • eslint.config.mjs
  • eslint.config.tight.mjs
  • package.json

Comment thread package.json Outdated
Signed-off-by: prxt6529 <prxt@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 2, 2026

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