fix(@vben/oxfmt-config): rename oxfmtConfig export to defaultOxfmtConfig#7699
fix(@vben/oxfmt-config): rename oxfmtConfig export to defaultOxfmtConfig#7699lileyzhao wants to merge 1 commit intovbenjs:mainfrom
Conversation
|
📝 WalkthroughWalkthroughA single configuration file is updated to rename the exported default oxfmt configuration constant from Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 Tip CodeRabbit can enforce grammar and style rules using `languagetool`.Configure the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@internal/lint-configs/oxfmt-config/src/index.ts`:
- Line 38: You removed the named export oxfmtConfig which is a breaking change
for consumers; restore a deprecated alias export so consumers still importing
oxfmtConfig work for one cycle: in the module that currently exports
defaultOxfmtConfig and defineConfig, add a named export oxfmtConfig that
references defaultOxfmtConfig (e.g., export const oxfmtConfig =
defaultOxfmtConfig) and mark it as deprecated in a comment/JS docstring; keep
defaultOxfmtConfig and defineConfig unchanged so both the new and old import
styles continue to function.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ba4d5882-a801-4f95-a66b-cbe2f278917c
📒 Files selected for processing (1)
internal/lint-configs/oxfmt-config/src/index.ts
| } | ||
|
|
||
| export { defineConfig, oxfmtConfig }; | ||
| export { defaultOxfmtConfig, defineConfig }; |
There was a problem hiding this comment.
Removing oxfmtConfig export introduces a breaking API change.
Line 38 drops the previous named export. Any consumer importing oxfmtConfig will fail to compile after this release. Please keep a deprecated alias for one cycle if this PR is intended as a non-breaking fix.
Proposed backward-compatible export patch
const defaultOxfmtConfig: OxfmtConfig = defineOxfmtConfig({
...
});
+/** `@deprecated` Use `defaultOxfmtConfig` instead. */
+const oxfmtConfig = defaultOxfmtConfig;
+
function defineConfig(config: OxfmtConfig = {}): OxfmtConfig {
return defineOxfmtConfig({
...defaultOxfmtConfig,
...config,
});
}
-export { defaultOxfmtConfig, defineConfig };
+export { defaultOxfmtConfig, defineConfig, oxfmtConfig };
export type { OxfmtConfig };📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export { defaultOxfmtConfig, defineConfig }; | |
| /** `@deprecated` Use `defaultOxfmtConfig` instead. */ | |
| const oxfmtConfig = defaultOxfmtConfig; | |
| function defineConfig(config: OxfmtConfig = {}): OxfmtConfig { | |
| return defineOxfmtConfig({ | |
| ...defaultOxfmtConfig, | |
| ...config, | |
| }); | |
| } | |
| export { defaultOxfmtConfig, defineConfig, oxfmtConfig }; | |
| export type { OxfmtConfig }; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@internal/lint-configs/oxfmt-config/src/index.ts` at line 38, You removed the
named export oxfmtConfig which is a breaking change for consumers; restore a
deprecated alias export so consumers still importing oxfmtConfig work for one
cycle: in the module that currently exports defaultOxfmtConfig and defineConfig,
add a named export oxfmtConfig that references defaultOxfmtConfig (e.g., export
const oxfmtConfig = defaultOxfmtConfig) and mark it as deprecated in a
comment/JS docstring; keep defaultOxfmtConfig and defineConfig unchanged so both
the new and old import styles continue to function.
|
Sorry for the noise. After adjusting some configuration settings in my IDE, it now correctly recognizes case sensitivity. This PR is no longer needed. Please close it. Thanks! |
Description
This change renames the exported preset config in
@vben/oxfmt-configfromoxfmtConfigtodefaultOxfmtConfig.Previously, the package exported the
OxfmtConfigtype and theoxfmtConfigvalue, which differ only by case. That can cause compiler or auto-import issues in some tooling and makes the public API less clear.Renaming the value export avoids the case-only collision and aligns the naming with the repository's existing
default*config style.Type of change
pnpm-lock.yamlunless you introduce a new test example.Checklist
pnpm run docs:devcommand.pnpm test.feat:,fix:,perf:,docs:, orchore:.Summary by CodeRabbit