Skip to content
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
merged 11 commits into from
Sep 26, 2023

Conversation

D4N14L
Copy link
Member

@D4N14L D4N14L commented Sep 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants