-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: config-helpers package #152
base: main
Are you sure you want to change the base?
Conversation
CI Test Types fails with |
Ah, actually steps are not the same. rewrite/.github/workflows/ci.yml Lines 57 to 80 in a57dd45
|
Co-authored-by: Milos Djermanovic <[email protected]>
f8f49e7
to
e72cdf5
Compare
Doesn't the current implementation allow infinite nesting? rewrite/packages/config-helpers/src/define-config.js Lines 385 to 387 in e72cdf5
For example, Namespace normalization works only at the first level, though. |
for (const { indexPath, value: extendsElement } of flatTraverse( | ||
objectExtends, | ||
)) { | ||
const extension = /** @type {Config} */ (extendsElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to check if this contains extends
key and throw an error saying that nested extends are not allowed. Otherwise, end user would get a template message saying that flat config system doesn't support extends
, which might be confusing since their top-level extends
passed to defineConfig()
are valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.
Prerequisites checklist
What is the purpose of this pull request?
Created a new
config-helpers
packageWhat changes did you make? (Give an overview)
Added
packages/config-helpers
directory..github/ISSUE_TEMPLATE/bug-report.yml
and.github/ISSUE_TEMPLATE/change.yml
: Added@eslint/config-helpers
label to the issue templates. [1] [2].github/workflows/release-please.yml
: Added steps to publish the@eslint/config-helpers
package to npm and JSR, and to post release announcements..release-please-manifest.json
: Added@eslint/config-helpers
to the release manifest.README.md
: Updated the list of packages to include@eslint/config-helpers
.Related Issues
Refs eslint/eslint#19116
Is there anything you'd like reviewers to focus on?
UserConfig[index]
and extended configs are nowExtendedConfig[index]
. Using the bracket notation allows us to more clearly indicate the presence of a multidimensional array.extends
as an array of arrays at maximum instead of infinite nesting. I'd like to see how far we get with this.eslint/migrate-config
package in this PR or a separate one. I opted for a separate one for now, but let me know if you think differently.