Skip to content

Rule suggestion: generalize @typescript-eslint/no-angle-bracket-type-assertion #332

@ThomasdenH

Description

@ThomasdenH

I would like to have a more general version of @typescript-eslint/no-angle-bracket-type-assertion, maybe called type-assertion. It would have two options, that can be enabled independently:

no-angle-bracket: If this is enabled, angle bracket type assertions are disallowed.
no-as: If this is enabled, as type assertions are disallowed.

This would allow different use cases. Some people like to use the old assertions instead of the new ones. Personally, I would like to lint all type casting since they introduce unsafety.

The default behaviour would be ['no-angle-bracket'] to match the current situation. If no options are enabled, the lint could warn that the lint can be disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement: plugin rule optionNew rule option for an existing eslint-plugin rulehas prthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions