fix: use overrideConfigFile: true + overrideConfig instead#1193
fix: use overrideConfigFile: true + overrideConfig instead#1193
overrideConfigFile: true + overrideConfig instead#1193Conversation
🦋 Changeset detectedLatest commit: f7c0ded The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughA new changeset file was added to document a patch-level fix. In the main source, the ESLint configuration override logic was updated to use Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
yarn install v1.22.22 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🪛 Biome (1.9.4)src/index.ts[error] 252-252: Avoid the delete operator which can impact performance. Unsafe fix: Use an undefined assignment instead. (lint/performance/noDelete) 🔇 Additional comments (8)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1193 +/- ##
=======================================
Coverage 99.67% 99.67%
=======================================
Files 2 2
Lines 310 311 +1
Branches 82 82
=======================================
+ Hits 309 310 +1
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the ESLint configuration and updates the test expectations to use a new noop output.
- Update ESLint configuration in src/index.ts to set overrideConfigFile to true and use overrideConfig, including targeted deletion of a plugins entry.
- Adjust test outputs in test/index.spec.ts by replacing calls to prettierLastOutput() with noopOutput() and updating string formatting for consistency.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/index.spec.ts | Replaces expected outputs with noopOutput() and updates quotes. |
| src/index.ts | Modifies ESLint configuration, enabling overrideConfigFile and refining plugin deletion. |
Comments suppressed due to low confidence (1)
test/index.spec.ts:134
- [nitpick] Ensure that the change in expected output from prettierLastOutput() to noopOutput() is fully covered by unit tests so that the new behavior is verified.
output: noopOutput(),
Signed-off-by: JounQin <admin@1stg.me>
commit: |
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 520166c in 2 minutes and 5 seconds. Click for details.
- Reviewed
84lines of code in2files - Skipped
0files when reviewing. - Skipped posting
7draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/index.ts:231
- Draft comment:
Mutating the passed eslintConfig by setting 'overrideConfigFile = true' could have side effects if the config is reused. Consider cloning the config before modification. - Reason this comment was not posted:
Confidence changes required:50%<= threshold50%None
2. src/index.ts:252
- Draft comment:
Using 'delete eslintConfig.overrideConfig.plugins!['@']' with a non‐null assertion and hardcoded key may be fragile. Consider checking if the property exists before deletion. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The code is a workaround for a specific ESLint bug. Looking at line 237, plugins is explicitly set to {} if undefined, so plugins will never be null here. The non-null assertion is actually correct in this case. The optional chaining suggestion would add unnecessary safety checks for a condition we know can't happen. The comment raises a valid point about code fragility in general. Optional chaining is often safer than non-null assertions. While optional chaining is generally good practice, in this specific case the non-null assertion is correct because we can prove plugins will never be null due to line 237's default value assignment. The comment should be deleted because it suggests a change that would add unnecessary safety checks in code where we can prove the value is never null.
3. test/index.spec.ts:1
- Draft comment:
Removal of the 'sonarjs/no-commented-code' lint rule is minor, but ensure it’s intentional to allow commented-out code for tracking known issues. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. test/index.spec.ts:131
- Draft comment:
Expected output changed from 'prettierLastOutput()' to 'noopOutput()'. Confirm that this matches the new intended behavior. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
5. test/index.spec.ts:187
- Draft comment:
Similarly, expected output is now 'noopOutput()' instead of 'prettierLastOutput()' for the globals test. Verify that the change is correct. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
6. test/index.spec.ts:284
- Draft comment:
The expected CSS output now uses double quotes instead of single quotes. Ensure that this formatting change is consistent with the configured rules. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
7. test/index.spec.ts:527
- Draft comment:
The previously commented-out noopOutput function is now active. Confirm that its returned output exactly matches the expected result in tests. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_aUV3TU0aRKEqgHMy
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
@coderabbitai We're using |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain@JounQin Thanks for letting me know! The error is occurring because CodeRabbit's environment uses an older version of Yarn that doesn't support Yarn v4's portal references ( You can do this by creating or updating a # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
tools:
eslint:
enabled: falseThis will prevent CodeRabbit from trying to run ESLint during reviews while keeping all other code review functionality intact. The warning will no longer appear in future PRs. 🏁 Script executed: Length of output: 3158 @JounQin Thanks for sharing that information. After examining your package.json, I can confirm that the issue is due to the Yarn v4 feature you're using: "devDependencies": {
"prettier-eslint": "portal:.",
},
"resolutions": {
"@prettier/eslint": "portal:.",
}The Since this is a proper setup for your project's development workflow and you shouldn't have to change it, the best solution is to disable the ESLint tool in CodeRabbit. You can do this by creating or updating a # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
tools:
eslint:
enabled: falseThis will prevent these warnings in future PR reviews while keeping all other code review functionality intact. |
related eslint/eslint#19722
Important
Set
overrideConfigFiletotrueand adjustoverrideConfigincreateEslintFixto address ESLint issue #19722.createEslintFixinindex.ts, seteslintConfig.overrideConfigFiletotrue.eslintConfig.overrideConfigto includelanguageOptions,rules,ignores,plugins, andsettings.eslintConfig.overrideConfig.plugins!['@']to address ESLint issue #19722.index.spec.tsto reflect changes in ESLint configuration handling.sonarjs/no-commented-codedisable comment inindex.spec.ts.This description was created by
for 520166c. You can customize this summary. It will automatically update as commits are pushed.
Summary by CodeRabbit
Bug Fixes
Tests