You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
import{Server,createServer}from'http';// unused variable: 'Server' (while it is used as return type)exportfunctiongetServer(){returncreateServer();}
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
The text was updated successfully, but these errors were encountered:
Hm, this is an interesting problem with implicit typedefs that hasn't really come up before. Not sure if we'll be able to identify Server as an implicitly-used type, especially without full type checker info (#680). For now I would suggest adding an explicit return type to getServer (IMO it's good practice to do so for exported APIs anyway).
Bug Report
3.8.0
1.8.10
TypeScript code being linted
with
tslint.json
: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 namedExpected behavior
no tslint error is reported
The text was updated successfully, but these errors were encountered: