[eslint-config] Remove rig ignore stopgap and eliminate config casts - #6045
Open
Ian Clanton-Thuon (iclanton) wants to merge 1 commit into
Open
Ian Clanton-Thuon (iclanton) wants to merge 1 commit into
Ian Clanton-Thuon (iclanton) wants to merge 1 commit into
Conversation
Now that @rushstack/eslint-config 4.8.0 globally ignores the build-output folders,
remove the duplicated build-output `ignores` that were temporarily added to
decoupled-local-node-rig.
Also eliminate avoidable casts in the eslint-config flat profile:
- Replace `globalIgnores(...) as Linter.Config` with plain `{ name, ignores }`
config objects, which are directly assignable to `Linter.Config` (removing the
now-unused `globalIgnores` import).
- Use `as object as ESLint.Plugin` (rather than `as unknown as`) in the
friendly-locals mixin for consistency. The single remaining `@typescript-eslint`
plugin cast is unavoidable: a direct `as ESLint.Plugin` fails (TS2352) because
typescript-eslint's rule types are intentionally not assignable to ESLint's.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or 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
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
Follow-ups to #6006 / #6026, now that
@rushstack/eslint-config@4.8.0is published and pulled back into the repo.Remove the build-output-ignore stopgap from
decoupled-local-node-rig#6006 temporarily duplicated the build-output
ignores(lib,lib-*,dist,temp,coverage) into the rig, because the published@rushstack/eslint-configdid not yet ignore them and the rig consumes the published version.4.8.0now globally ignores those folders, so the rig-level duplication is removed — consumers inherit the ignores from the base profile.Eliminate avoidable casts in the eslint-config flat profile
globalIgnores(...) as Linter.Configwith plain{ name, ignores }config objects, which are directly assignable toLinter.Config(and remove the now-unusedglobalIgnoresimport). These are ordinary flat-config global-ignores objects, so behavior is unchanged.as object as ESLint.Plugin(rather thanas unknown as) in thefriendly-localsmixin, for consistency with the profile.The one remaining
@typescript-eslintplugin cast is unavoidable: a directas ESLint.Pluginfails withTS2352because typescript-eslint'sRuleModuletypes are intentionally not assignable to ESLint'sRuleDefinition. It stays as the tighteras object as ESLint.Plugin.Not included: TypeScript conversion of the rig's ESLint configs
We considered converting
decoupled-local-node-rig's ESLint configs to TypeScript (as was done for@rushstack/eslint-config) but decided against it:extends, and heft/jest/api-extractorextendsvia package specifiers). Standing up a TS build would require either an exhaustive/fragileexportsmap (risking heft/jest/api-extractor resolution) or an in-place build — a lot of surface area/risk to type-check a handful of tiny config files that are already runtime-validated by every lint run.@rushstack/eslint-configand selectively overrides it (itslocalCommonConfighas 0 rules that merely duplicate the published profile; it is 5 intentional overrides plus 19 repo-specific additions).How it was tested
heft buildin@rushstack/eslint-config: passed (TypeScript + self-lint)heft test --cleaninbuild-tests/eslint-9-test: passed; build output (lib-commonjs/lib-esm) is still ignored andeslint.config.jsis still linted (confirms the ignores are inherited from the base profile after removing the rig stopgap)rush rebuildfor@rushstack/eslint-plugin(a decoupled-rig consumer): self-lints cleanrush change --verify