-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyFix AvailableA PR has been opened for this issueA PR has been opened for this issuecheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript
Milestone
Description
Since the "JS require is alias" PR went in, in JS:
Prerequisite: install shelljs but NOT @types/shelljs.
const sh = require('shelljs') // no types, so `sh` is implicitly any
sh.config.fatal = true // assignment is interpreted as assignment declaration
sh.exec('npm pack') // `sh` is no longer properly `any`, so error that `exec` is not found.
Expected behavior:
No error, like typescript:
import sh = require('shelljs')
sh.config.fatal = true // ok, whatever, it's any
sh.exec('npm pack') // still any!
Actual behavior:
Property exec
doesn't exist on type typeof shell
.
Workaround:
Install @types/shelljs
.
The best probable fix is to disable assignment declarations to JS aliases. It doesn't make sense to me. However, this might not happen enough to be worth fixing.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyFix AvailableA PR has been opened for this issueA PR has been opened for this issuecheckJsRelates to checking JavaScript using TypeScriptRelates to checking JavaScript using TypeScript