Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug: suppressTypeErrors: program's compilerOptions are malformed #1532

Open
3 tasks done
rubiesonthesky opened this issue Apr 5, 2024 · 1 comment · May be fixed by #1542 or #2053
Open
3 tasks done

🐛 Bug: suppressTypeErrors: program's compilerOptions are malformed #1532

rubiesonthesky opened this issue Apr 5, 2024 · 1 comment · May be fixed by #1542 or #2053
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :( 🐛

Comments

@rubiesonthesky
Copy link
Collaborator

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Expected

Using request.services.program.getCompilerOptions() in suppressRemainingTypeIssues would give correctly formatted compiler options.

{
  "declaration": true,
  "declarationMap": true,
  "esModuleInterop": true,
  "module": "NodeNext",
  "moduleResolution": "NodeNext",
  "noEmit": true,
  "outDir": "lib",
  "resolveJsonModule": true,
  "skipLibCheck": true,
  "sourceMap": true,
  "strict": true,
  "target": "ES2022"
}

Actual

Instead it gives this

  "compilerOptions": {
    "declaration": true,
    "declarationMap": true,
    "esModuleInterop": true,
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "noEmit": true,
    "outDir": "lib",
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "target": "ES2022"
  },
  "include": [
    "test/postProcessing.test.ts",
   // some omitted
  ],
  "compileOnSave": false,
  "noImplicitAny": false,
  "noImplicitThis": false,
  "strictNullChecks": false
}

Additional Info

I think this same problem is in other parts of the code. I started debugging and I feel that there is are few places where different data structures are accidentally mixed.

I think it would be safer to keep ts.CompilerOptions as pure and not to try to add includes there. If we want full tsConfig, then we should name it so and not as compilerOptions. I think, this has been oversight in some refactoring. For me it looks like this once was working correctly, but later changes were trusting too much that compilerOptions would mean pure compiler options etc.

I think this is bigger refactor and not so straightforward. It's hard to know why there are some code duplication which seems to do same thing but is doing it differently. It's high possibility that this is intended but it's also possible that this has been oversight some point of time.

@rubiesonthesky
Copy link
Collaborator Author

I have fix for this but it's kinda blocked by #1534 and #1530

I'm able to get test pass now without erroneous ts-expect-comments.

@rubiesonthesky rubiesonthesky added the status: accepting prs Please, send a pull request to resolve this! 🙏 label Apr 7, 2024
@rubiesonthesky rubiesonthesky linked a pull request Apr 7, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send a pull request to resolve this! 🙏 type: bug Something isn't working :( 🐛
Projects
None yet
1 participant