Repository navigation
feat!: make exadevConfig take the options object alone - #130
Conversation
`exadevConfig(options, ...userConfigs)` forced a caller who only wanted to append their own
blocks to pass an empty options object first, and a block passed in the options slot was typed as
options and its keys silently ignored. The factory now takes `options` only and returns the
config array; callers append their own blocks by spreading the result inside `defineConfig`.
The README, the factory's tests and the tests of each option that previously exercised trailing
blocks follow the new shape. The default export is still `exadevConfig()` evaluated once.
Migration: `exadevConfig({}, a, b)` becomes `defineConfig(...exadevConfig(), a, b)`, and
`exadevConfig({ react: false }, a)` becomes `defineConfig(...exadevConfig({ react: false }), a)`.
BREAKING CHANGE: `exadevConfig` no longer accepts config blocks after the options argument.
Spread its result inside `defineConfig` and put your own blocks after it.
A function whose parameter list ends with an optional parameter followed by a rest parameter forces a caller who wants only the rest values to pass a placeholder for the optional one. The trailing optional run has length one, so `minTrailingOptional` (schema minimum 2) never saw it. `exadev/prefer-options-object-param` now reports that shape under its own message id, `placeholderBeforeRest`, and offers no suggestion because the right shape (the rest values alone, or one object holding the optional value and the rest values) is a design decision. Runs that reach `minTrailingOptional` keep their existing report.
ddba4e5 to
db572e1
Compare
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
exadevConfig(options, ...userConfigs)makes anyone who only wants to append a block pass{}first, and a block passed in the options slot is typed as options and its keys are ignored. The signature is nowexadevConfig(options = {}), and blocks go after the spread insidedefineConfig.exadev/prefer-options-object-paramcould not see this shape because it counts a run of trailing optional parameters and the run here has length one. It now reports an optional parameter directly before a rest parameter under its own message, with no suggestion (the right shape is a design decision). Before the signature change I ran the extended rule against the old signature (pnpm exec eslint .); it reported exactly one function in the repository,exadevConfig(log:exadevconfig-evidence/lint-before-signature-change.txt, kept outside the repository). The commits are ordered so each one passes lint, typecheck and tests on its own: the signature change comes first, then the rule extension, which the repository already satisfies.Migration for consumers:
Fixes #129