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

Can't parse default export expression containing "as assertion" with ts instantiation #23118

Closed
xlsft opened this issue Mar 28, 2024 · 2 comments

Comments

@xlsft
Copy link

xlsft commented Mar 28, 2024

Version: Deno 1.41.2
Deno can not lint this code

Error linting: /home/software/smartshell-sdk/src/graphql/mutation/login.ts
   Expected ';', got ',' at file:///home/software/smartshell-sdk/src/graphql/mutation/login.ts:31:33

  export default module<QueryInput, QueryResponse> as ShellSdkModule
                                  ~
Error linting: /home/software/smartshell-sdk/src/graphql/query/userClubs.ts
   Expected ';', got ',' at file:///home/software/smartshell-sdk/src/graphql/query/userClubs.ts:39:33

  export default module<QueryInput, QueryResponse[]> as ShellSdkModule

for some reason it expects comma be a semicolon
also affects jsr linter

@dsherret dsherret changed the title deno lint - cant parse default export function with generics Can't parse default export expression containing "as assertion" with ts instantiation Mar 28, 2024
@dsherret
Copy link
Member

Let's track this in #22375 as that's linked to the swc issue (swc-project/swc#8627)

@dsherret
Copy link
Member

By the way, as a workaround, I think it's possible to do:

const temp = module<QueryInput, QueryResponse[]>;
export default  temp  as ShellSdkModule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants