Skip to content

fix: prevent race condition running checker before eslint config is written#653

Merged
antfu merged 1 commit intonuxt:mainfrom
sebbayer:fix/write-config-checker-race-condition
Feb 24, 2026
Merged

fix: prevent race condition running checker before eslint config is written#653
antfu merged 1 commit intonuxt:mainfrom
sebbayer:fix/write-config-checker-race-condition

Conversation

@sebbayer
Copy link
Copy Markdown
Contributor

This PR prevents a race condition on the first run of yarn dev when this module has the checker option enabled.

🔗 Linked issue

resolves #652

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 20, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

The change modifies the builder:generateApp hook callback in the config module to be asynchronous. The writeConfigFile operation is now awaited, ensuring the configuration file is fully written to disk before the hook completes. This prevents a race condition where subsequent processes attempt to read the configuration file before it has been created.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: preventing a race condition where the checker runs before the ESLint config file is written.
Description check ✅ Passed The PR description is related to the changeset, explaining the race condition issue and referencing the linked issue #652 that it resolves.
Linked Issues check ✅ Passed The code changes directly address the requirements in issue #652 by making the builder:generateApp hook callback async and awaiting the writeConfigFile operation to prevent the checker from running before the config file is written.
Out of Scope Changes check ✅ Passed The changes are strictly scoped to fixing the race condition described in issue #652; no unrelated modifications were introduced.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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.

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.

Pre-transform error: The requested module does not provide an export named 'withNuxt'

2 participants