Skip to content

feat!: make exadevConfig take the options object alone - #130

Merged
Mearman merged 2 commits into
mainfrom
feat/exadevconfig-options-only
Oct 10, 2026
Merged

Mearman merged 2 commits into
mainfrom
feat/exadevconfig-options-only

Conversation

@Mearman

@Mearman Mearman commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

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 now exadevConfig(options = {}), and blocks go after the spread inside defineConfig.

exadev/prefer-options-object-param could 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:

// before
export default exadevConfig({}, a, b);
export default defineConfig(exadevConfig({ react: false }, a));

// after
export default defineConfig(...exadevConfig(), a, b);
export default defineConfig(...exadevConfig({ react: false }), a);

Fixes #129

`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.
@Mearman
Mearman force-pushed the feat/exadevconfig-options-only branch from ddba4e5 to db572e1 Compare October 10, 2026 07:26
@Mearman
Mearman marked this pull request as ready for review October 10, 2026 07:35
@Mearman

Mearman commented Oct 10, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-10T07:38:10.843773Z db572e1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: db572e1558

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Mearman
Mearman merged commit 198b011 into main Oct 10, 2026
10 checks passed
@Mearman
Mearman deleted the feat/exadevconfig-options-only branch October 10, 2026 07:38
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

exadevConfig needs an empty options placeholder that prefer-options-object-param cannot see

1 participant