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

array-type doesn't consider "object" to be a simple type #2351

Closed
lambda-fairy opened this issue Mar 15, 2017 · 0 comments
Closed

array-type doesn't consider "object" to be a simple type #2351

lambda-fairy opened this issue Mar 15, 2017 · 0 comments
Milestone

Comments

@lambda-fairy
Copy link

Bug Report

  • TSLint version: 4.5.1
  • TypeScript version: 2.2.1
  • Running TSLint via: CLI

TypeScript code being linted

function foo(a: object[]): object[] {
    return a;
}

with tslint.json configuration:

{
    "extends": "tslint:recommended",
    "array-type": [true, "array-simple"]
}

Actual behavior

test.ts[1, 17]: Array type using 'T[]' is forbidden for non-simple types. Use 'Array<T>' instead.
test.ts[1, 28]: Array type using 'T[]' is forbidden for non-simple types. Use 'Array<T>' instead.

Expected behavior

No warnings reported, since object should be considered a simple type along with e.g. number and string. See the TypeScript 2.2 release notes.

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