oby icon indicating copy to clipboard operation
oby copied to clipboard

Exclude tsconfig.json from npm dist

Open FlatMapIO opened this issue 2 years ago • 3 comments

I have been using TypeScript 5.x in a new project and I have noticed that when I press F8 to track errors, VSCode often jumps to the node_modules/oby/tsconfig.json file and prompts me that it cannot find the tsex/tsconfig.json file. This also causes a lot of import statements in the node_modules/oby/src directory to be marked as red errors when I browse through the code. I hope that these tsconfig.json files can be excluded when the npm package is released next time. I also hope that the same setting can be adopted in voby.

FlatMapIO avatar Apr 03 '23 09:04 FlatMapIO

Do you have skipLibCheck set to false in your tsconfig.json? 🤔

fabiospampinato avatar Apr 03 '23 15:04 fabiospampinato

Yes, I have noticed this change that occurred in ts 5.0x. This is my tsconfig.json:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    "moduleResolution": "bundler",
    "module": "ESNext",
    "target": "ESNext",
    "esModuleInterop": true,
    "inlineSources": false,
    "isolatedModules": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "resolveJsonModule": true,
    "strict": true,
    "lib": [
      "DOM",
      "DOM.Iterable",
      "ESNext"
    ],
    "jsx": "react-jsx",
    "jsxImportSource": "voby",
    "baseUrl": ".",
    "types": [
      "vitest/globals",
      "vite/client"
    ],
    "paths": {
      "~/*": [
        "./src/*"
      ]
    }
  },
  "include": [
    "src"
  ],
  "exclude": [
    "dist",
    "build",
    "node_modules"
  ]
}

FlatMapIO avatar Apr 04 '23 01:04 FlatMapIO

I think we should wait and see if TS fixes this on their end, in the mean time maybe it's worth not upgrading to v5 just yet.

Maybe there's something that could be changed in the way the repository is currently organized, maybe some settings in tsconfig can be tweaked to hide those errors.

fabiospampinato avatar Apr 14 '23 15:04 fabiospampinato