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

Determine correct moduleDetection compiler option (TypeScript 4.7) #13924

Closed
kitsonk opened this issue Mar 12, 2022 · 5 comments · Fixed by #14875
Closed

Determine correct moduleDetection compiler option (TypeScript 4.7) #13924

kitsonk opened this issue Mar 12, 2022 · 5 comments · Fixed by #14875
Assignees
Labels
feat new feature (which has been agreed to/accepted) tsc related to the TypeScript tsc compiler

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Mar 12, 2022

Ref: microsoft/TypeScript#47495

The next minor release of TypeScript (4.7) should include a new moduleDetection option, which has to deal with how modules are detected by TypeScript when type checking. The default is "auto", which might be ok for us, but also there is "force" which is more the behaviour that we would expect for code running under Deno. We need to do a bit of experiment and testing.

The issue mostly manifested itself around issues in the lsp when having a file open with no top level import or export statement being treated a global script for type checking purposes. There were also some issues with emitting @jsxImportSource with modules that appeared to be scripts.

@kitsonk kitsonk added feat new feature (which has been agreed to/accepted) tsc related to the TypeScript tsc compiler labels Mar 12, 2022
@kitsonk kitsonk self-assigned this Mar 12, 2022
@kitsonk
Copy link
Contributor Author

kitsonk commented Mar 12, 2022

Ref #12631 and microsot/TypeScript#46723 which relate to the @jsxImportSource issue.

@nayeemrmn

This comment was marked as outdated.

@nayeemrmn

This comment was marked as outdated.

@nayeemrmn

This comment was marked as outdated.

@nayeemrmn
Copy link
Collaborator

Disregard previous comments. We should just use "moduleDetection": "force" all the way, I misunderstood that modules refer to both esm and cjs, as opposed to old-fashioned browser scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted) tsc related to the TypeScript tsc compiler
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants