danger / danger-js

⚠️ Stop saying "you forgot to …" in code review
http://danger.systems/js/
MIT License
5.26k stars 368 forks source link

[BUG] Include dangerfile.ts in the tsconfig makes tsc run out of memory #1408

Closed eppisapiafsl closed 11 months ago

eppisapiafsl commented 11 months ago

Describe the bug A clear and concise description of what the bug is.

After add the danger file to the include list in the tsconfig The command tsc run out of memory

To Reproduce Steps to reproduce the behavior:

  1. Add the danger file to the tsconfig include list

    // Reference: https://github.com/tsconfig/bases/blob/main/bases/react-native.json
    {
    "$schema": "https://json.schemastore.org/tsconfig",
    "display": "React Native",
    "_version": "3.0.2",
    "compilerOptions": {
    "target": "ES6",
    "lib": [
      "es2019",
      "es2020.bigint",
      "es2020.date",
      "es2020.number",
      "es2020.promise",
      "es2020.string",
      "es2020.symbol.wellknown",
      "es2021.promise",
      "es2021.string",
      "es2021.weakref",
      "es2022.array",
      "es2022.object",
      "es2022.string"
    ],
    "types": ["react-native", "jest"],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "baseUrl": ".",
    "module": "CommonJS",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "noEmit": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "strictPropertyInitialization": true,
    "alwaysStrict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "jsx": "react-native",
    "paths": {
      "react-native-twilio-video-webrtc": [
        "src/typings/react-native-twilio-video-webrtc"
      ],
      "@/*": ["src/*"],
      "@root/*": ["./*"],
      "@components/*": ["src/components/*"],
      "@modules/*": ["src/modules/*"]
    }
    },
    "include": [
    "src",
    "jest.setup.tsx",
    "jest.setupAfterEnv.ts",
    
    "dangerfile.ts"
    ],
    "exclude": []
    }
  2. Run tsc, yarn tsc
  3. Experience OOM

Expected behavior tsc should end successfully

Screenshots

Screenshot 2023-10-18 at 11 58 54 AM

Your Environment

software version
danger.js 11.2.1
node 18.15.0
npm 9.5.0
Operating System MacOS - Apple chip

Additional context

Running in GitHub ubutun machine, I able to run the tsc config after increase the node memory to 8gb

orta commented 11 months ago

No idea, tsc shouldn't be doing that anyway, so if you can get the typescript team a repro I think they'd be happy, but a dangerfile is just a single ts file

eppisapiafsl commented 11 months ago

Thanks for the quick response @orta

Yeah... it was just coincidence it happen when I added danger 😞