Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

unknown support for 'array-type' #4085

Closed
ThomasdenH opened this issue Jul 31, 2018 · 2 comments
Closed

unknown support for 'array-type' #4085

ThomasdenH opened this issue Jul 31, 2018 · 2 comments

Comments

@ThomasdenH
Copy link
Contributor

Bug Report

  • TSLint version: 5.11.0
  • TypeScript version: 3.0.1
  • Running TSLint via: CLI

TypeScript code being linted

const a: unknown[] = [];

with tslint.json configuration:

{
  "rules": {
    "array-type": [true, "array-simple"],
  }
}

Actual behavior

TSLint recommends Array<unknown> instead of unknown[].

Expected behavior

unknown[] is considered a simple type and thus be preferred over Array<unknown>.

@johnwiseheart
Copy link
Contributor

We should definitely accept the unknown type as a simple type. Happy to review a PR for this.

@ThomasdenH
Copy link
Contributor Author

Since unknown was added in Typescript 3.0.0, how to add this rule with backwards compatibility?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants