-
Notifications
You must be signed in to change notification settings - Fork 604
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
[eslint-patch] Allow for extended shareable ESLint configurations to use any name #4353
Merged
iclanton
merged 11 commits into
microsoft:main
from
D4N14L:user/danade/EslintResolverTweaks2
Sep 26, 2023
Merged
[eslint-patch] Allow for extended shareable ESLint configurations to use any name #4353
iclanton
merged 11 commits into
microsoft:main
from
D4N14L:user/danade/EslintResolverTweaks2
Sep 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
D4N14L
requested review from
iclanton,
octogonz,
apostolisms,
dmichon-msft and
patmill
as code owners
September 25, 2023 23:31
iclanton
approved these changes
Sep 25, 2023
common/changes/@rushstack/eslint-config/user-danade-EslintResolverTweaks2_2023-09-25-23-36.json
Outdated
Show resolved
Hide resolved
common/changes/@rushstack/eslint-patch/user-danade-EslintResolverTweaks2_2023-09-25-23-36.json
Outdated
Show resolved
Hide resolved
common/changes/@rushstack/heft-node-rig/user-danade-EslintResolverTweaks2_2023-09-25-23-36.json
Outdated
Show resolved
Hide resolved
common/changes/@rushstack/heft-web-rig/user-danade-EslintResolverTweaks2_2023-09-25-23-36.json
Outdated
Show resolved
Hide resolved
rigs/heft-node-rig/profiles/default/includes/eslint/profile/node-trusted-tool.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Allows resolution of extended shareable configurations even when the package they are sourced from is not prefixed with
eslint-config-
.Details
In order to allow use of ESLint configurations provided via Heft rigs, we need to allow consumption of configurations from packages not prefixed with
eslint-config-
, since Heft rigs obviously do not have the same naming restrictions.The solution first attempts to resolve using the default logic, and falls back to attempting to resolve using the provided extended config name directly, without modification. This is done to allow for backwards-compatibility with intentionally short-named extended configs (cases where the prefix is intentionally omitted), since ESLint prefixes the
eslint-config-
to the package name during normalization if it was not found. For example, if@rushstack
was specified as an extends configuration, then it would normally resolve to @rushstack/eslint-config.How it was tested
Tested using resolution logic in Rushstack by moving the ESLint configuration into the rig. A future change will transition Rushstack to use the @rushstack/eslint-config package via
@rushstack/heft-node-rig
/@rushstack/heft-web-rig
/local-node-rig
/local-web-rig