-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
TypeScript Version: 3.4.0-dev.20190223
Search Terms:
module.filename
require.main === module
Code
// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.
module.exports = function(){
return module.filename;
} Expected behavior:
Should not emit any error
Actual behavior:
D:\test>node_modules\.bin\tsc -v
Version 3.4.0-dev.20190223
D:\test>node_modules\.bin\tsc
test.js:2:17 - error TS2339: Property 'filename' does not exist on type '{ "D:/test/test": () => any; }'.
2 return module.filename;
~~~~~~~~
Found 1 error.
Playground Link:
tsconfig.json:
{
"compilerOptions": {
"noEmit": true,
"checkJs": true,
"allowJs": true,
"resolveJsonModule": true,
"module": "commonjs",
"lib": ["es2018"],
"target": "es2018",
"baseUrl": ".",
"paths": {
"@/*": [
"../*"
],
"#/*": [
"./*"
]
},
"types": [
"node"
],
},
"exclude": [
"node_modules",
"public"
]
}Related Issues:
DefinitelyTyped/DefinitelyTyped#33357
Hotell
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.