run yarn tsc4p1
= "using private name" error
run yarn tsc4p0
= "using private name" error
/** | |
* @param {string} a | |
*/ | |
function bar(a) { | |
return a + a; | |
} | |
class SomeClass { | |
a() { | |
return 1; | |
} | |
} | |
module.exports = { | |
bar, | |
SomeClass | |
} |
const { SomeClass } = require('./lib'); | |
const IntermediateClass = SomeClass; | |
module.exports = { | |
IntermediateClass, | |
} |
{ | |
"name": "using-private-name-emit-types-from-js-issue-still-an-issue", | |
"version": "1.0.0", | |
"author": "Bnaya Peretz", | |
"license": "MIT", | |
"private": "true", | |
"scripts": { | |
"tsc4p0": "npx -p [email protected] tsc", | |
"tsc4p1": "npx -p [email protected] tsc" | |
}, | |
"devDependencies": { | |
"typescript": "^4.1.0-dev.20201021" | |
} | |
} |
{ | |
"compilerOptions": { | |
"target": "ES2020", | |
"module": "commonjs", | |
"lib": ["ES2020"], | |
"allowJs": true, | |
"checkJs": true, | |
"declaration": true, | |
"declarationMap": true, | |
"sourceMap": true, | |
"outDir": "./dist", | |
"rootDir": "./", | |
"composite": true, | |
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo", | |
"isolatedModules": true, | |
"strict": true, | |
"types": [], | |
"esModuleInterop": true, | |
"skipLibCheck": true, | |
"forceConsistentCasingInFileNames": true | |
}, | |
"include": ["main.js", "lib.js"], | |
"exclude": ["dist"] | |
} |
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | |
# yarn lockfile v1 | |
typescript@^4.1.0-dev.20201021: | |
version "4.1.0-dev.20201021" | |
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.0-dev.20201021.tgz#0e12186483bfad5fffd59898c434adc750f3c605" | |
integrity sha512-AysECaeZgcDxcSDtzFq3hBwJ7cCG7md0gWBZIH19UPDcGtJBaAM6F/NCT4LZ4AV2NeGLQtEAGzE53lMq/i5whw== |