Closed supermacro closed 4 years ago
I ran ts-unused-exports ./tsconfig.json and got a "false positive" for a default export (i.e. the default export is in fact being used).
ts-unused-exports ./tsconfig.json
My tsconfig.json:
{ "compilerOptions": { "module": "CommonJS", "noImplicitAny": true, "sourceMap": false, "downlevelIteration": true, "noUnusedLocals": true, "noUnusedParameters": true, "strictNullChecks": true, "baseUrl": "./src", "lib": [ "dom", "es2016", "es2017.object" ], "outDir": "build" }, "include": [ "src/**/*.ts" ], "exclude": [ "node_modules", "**/*.spec.ts" ] }
The file with the default export
import { Admin } from 'prisma-client' type CUID = Admin['id'] const sessionMap = new Map<CUID, {}>() export default sessionMap
I immediately saw that I had 2 duplicated files! My bad 🙈
I ran
ts-unused-exports ./tsconfig.json
and got a "false positive" for a default export (i.e. the default export is in fact being used).My tsconfig.json:
The file with the default export