We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
emit dts fails on non-exported expressions which are part of an exported class. This fails with swc: playground but passes with tsc: playground
swc
tsc
const A_SYMBOL = Symbol("A_SYMBOL"); const func = () => null; export class SomeClass { private func( queryFingerprint: string, onStale: () => void ): null | typeof A_SYMBOL { return null; }; private func2( queryFingerprint: string, onStale: () => void ): null | typeof func { return null; }; }
{ "jsc": { "parser": { "syntax": "typescript", "tsx": true }, "experimental": { "emitIsolatedDts": true } }, "sourceMaps": true }
https://play.swc.rs/?version=1.10.16&code=H4sIAAAAAAAAA7WQMQ%2BCMBCF9%2F6KixMkTo4QTNTESePQyclgPQhJabFciQT579YKGuLg5C3v8vru%2BrVCq5pgdeLH%2FfqwgwR4W561DGajNQtjJnwos0q4QBBCsgRlpYwZw1ulDYGQaV0D1yVufNcxcFWZokkJ%2FWDgnbGuFk27LVSOxoUURVCT03w%2BSWnFKZUYDVc2uri8z8PII8AdqK1QZ58ndJMdBskaNeA%2Bjf4lX4CLvxP6%2F%2FtN17MHmuP435QBAAA%3D&config=H4sIAAAAAAAAA1WMOQ6AMAwEe14RueYF1DQUPCIKLoI4LNtIQYi%2FY64Iut0Z7W6Fc9BLgMptFq2QZ0HO3Yisk%2FpkBHQllMCRFMrXqpxKecGL7LcATIQcR7Tp8Dk7zRi1kXnwil2t8hsXzwHIvHDA1lP2%2BwE5e0RDqwAAAA%3D%3D
x TS9010: Variable must have an explicit type annotation with --isolatedDeclarations. ,-[input.tsx:1:1] 1 | const A_SYMBOL = Symbol("A_SYMBOL"); : ^^^^^^^^ 2 | const func = () => null; 3 | 4 | export class SomeClass { ---- x TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ,-[input.tsx:2:1] 1 | const A_SYMBOL = Symbol("A_SYMBOL"); 2 | const func = () => null; : ^^^^^^^ 3 | 4 | export class SomeClass { 5 | private func( ----
---- x TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ,-[input.tsx:2:1] 1 | const A_SYMBOL = Symbol("A_SYMBOL"); 2 | const func = () => null; : ^^^^^^^ 3 | 4 | export class SomeClass { 5 | private func(
shoud emit this dts:
export declare class SomeClass { private func; private func2; }
Fails to output dts
1.10.16
No response
The text was updated successfully, but these errors were encountered:
8410b59
CPunisher
Successfully merging a pull request may close this issue.
Describe the bug
emit dts fails on non-exported expressions which are part of an exported class.
This fails with
swc
: playgroundbut passes with
tsc
: playgroundInput code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.10.16&code=H4sIAAAAAAAAA7WQMQ%2BCMBCF9%2F6KixMkTo4QTNTESePQyclgPQhJabFciQT579YKGuLg5C3v8vru%2BrVCq5pgdeLH%2FfqwgwR4W561DGajNQtjJnwos0q4QBBCsgRlpYwZw1ulDYGQaV0D1yVufNcxcFWZokkJ%2FWDgnbGuFk27LVSOxoUURVCT03w%2BSWnFKZUYDVc2uri8z8PII8AdqK1QZ58ndJMdBskaNeA%2Bjf4lX4CLvxP6%2F%2FtN17MHmuP435QBAAA%3D&config=H4sIAAAAAAAAA1WMOQ6AMAwEe14RueYF1DQUPCIKLoI4LNtIQYi%2FY64Iut0Z7W6Fc9BLgMptFq2QZ0HO3Yisk%2FpkBHQllMCRFMrXqpxKecGL7LcATIQcR7Tp8Dk7zRi1kXnwil2t8hsXzwHIvHDA1lP2%2BwE5e0RDqwAAAA%3D%3D
SWC Info output
x TS9010: Variable must have an explicit type annotation with --isolatedDeclarations.
,-[input.tsx:1:1]
1 | const A_SYMBOL = Symbol("A_SYMBOL");
: ^^^^^^^^
2 | const func = () => null;
3 |
4 | export class SomeClass {
---- x TS9007: Function must have an explicit return type annotation with --isolatedDeclarations. ,-[input.tsx:2:1] 1 | const A_SYMBOL = Symbol("A_SYMBOL"); 2 | const func = () => null; : ^^^^^^^ 3 | 4 | export class SomeClass { 5 | private func(
----Expected behavior
shoud emit this dts:
Actual behavior
Fails to output dts
Version
1.10.16
Additional context
No response
The text was updated successfully, but these errors were encountered: