run yarn tsc4p1
= Crash!!
run yarn tsc4p0
= "private name error is expected"
/** | |
* @param {string} a | |
*/ | |
function bar(a) { | |
return a + a; | |
} | |
class SomeClass { | |
a() { | |
return 1; | |
} | |
} | |
module.exports = { | |
bar, | |
SomeClass | |
} |
const { SomeClass } = require('./lib'); | |
module.exports = { | |
SomeClass, | |
} |
{ | |
"name": "ya-emit-types-from-js-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" | |
} | |
} |
{ | |
"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"] | |
} |