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

no-unused-variable: false positive for exported function return type #1157

@msklvsk

Description

@msklvsk

Bug Report

  • TSLint version: 3.8.0
  • TypeScript version: 1.8.10
  • Running TSLint via: gulp-tslint

TypeScript code being linted

import {Server, createServer} from 'http';
// unused variable: 'Server' (while it is used as return type)

export function getServer() {
  return createServer();
}

with tslint.json:

{
  "rules": {
    "no-unused-variable": true
  }
}

Actual behavior

An error unused variable: 'Server' is reported, but it is used as a return type and removing Server from imports causes a native typescript error: Return type of exported function has or is using name 'Server' from external module "http" but cannot be named

Expected behavior

no tslint error is reported

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions