-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Enhancement: [ban-types] Split the {} ban into a separate, better-phrased rule #8700
Copy link
Copy link
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Milestone
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueenhancement: plugin rule optionNew rule option for an existing eslint-plugin ruleNew rule option for an existing eslint-plugin rulelocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.package: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Before You File a Proposal Please Confirm You Have Done The Following...
My proposal is suitable for this project
Link to the rule's documentation
https://typescript-eslint.io/rules/ban-types/
Description
Filing this issue as a followup/superset of the more targeted #8697. As of microsoft/TypeScript#49119, TypeScript has much better handling of
{}semantics than it did when theban-typesdefault options were written. @RyanCavanaugh -the dev lead for TypeScript- called out in microsoft/TypeScript#57735 (comment) that as it stands today,{ }is a valid type with a valid meaning in TypeScript.Proposal: let's re-think the default options in
ban-typesto agree with the way TypeScript now works?My first proposal would be, roughly...
{}altogether, including inrecommendedandstrictNonNullable<unknown>that suggests switching to{}...but I'd want to hear from @bradzacher and @RyanCavanaugh on whether that satisfies the intents of both TypeScript and
ban-types.Fail
Pass
Additional Info
For clarity, the intent of the two issues I'm filing are:
ban-types, which might take some timerecommendedexperience, which can land firstIf this issue is resolved before #8697, that's great too.