Skip to content

Enhancement: configuration option to error on unsupported TypeScript version (onUnsupportedTypeScriptVersion=error) #10092

@mluypaert

Description

@mluypaert

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-eslint

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

When using an unsupported TypeScript version, my automated testing should test for this, and fail, as using an unsupported TypeScript version can cause unexpected and unwanted behavior.

The current warnOnUnsupportedTypeScriptVersion behavior (when set to true) is to display a warning message, but not fail the testing. While useful for testing new typescript version, this is not desired behaviour in a production environment, where I want my (style) tests to be reliable and updates to typescript to be testable in an safe and automated way. The output of these ESlint tests are not inspected manually, and only errors will be detected.

My solution proposal would be to update the warnOnUnsupportedTypeScriptVersion configuration option to become onUnsupportedTypeScriptVersion instead, with possible values

  • warn to only display unsupported typescript version message (the current default, equal to warnOnUnsupportedTypeScriptVersion=true)
  • error to display unsupported typescript version message and fail/error (new behavior)
  • ignore to not display anything on usage of unsupported typescript version and just run the tests as if the typescript version would be supported (equal to warnOnUnsupportedTypeScriptVersion=false).

I would further argue that given the above solution proposal, error should be the default behaviour, as it is safer than warn and ignore.

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions