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

fix(js_parser): Illegal duplicate default export declarations #1053

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

suxin2017
Copy link
Contributor

@suxin2017 suxin2017 commented Dec 5, 2023

Summary

fix #1037

    const fn can_merge(a: &ExportDefaultItemKind, b: &ExportDefaultItemKind) -> bool {
        match (a, b) {
            // export default function a():void;
            // export default function a(){
            // }
            (
                ExportDefaultItemKind::FunctionOverload,
                ExportDefaultItemKind::FunctionDeclaration,
            ) => true,
            // export default function a(){};
            // export default interface A{};
            (ExportDefaultItemKind::FunctionDeclaration, ExportDefaultItemKind::Interface) => true,
            // export default interface A{};
            // export default class A{};
            (ExportDefaultItemKind::Interface, ExportDefaultItemKind::ClassDeclaration) => true,
            (_, _) => false,
        }
    }

add can merge function

merge interface and class...

Test Plan

update snapshot

Copy link

netlify bot commented Dec 5, 2023

Deploy Preview for rad-torte-839a59 ready!

Name Link
🔨 Latest commit 2e77e61
🔍 Latest deploy log https://app.netlify.com/sites/rad-torte-839a59/deploys/656e94ee3249e800085df66e
😎 Deploy Preview https://deploy-preview-1053--rad-torte-839a59.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added A-Parser Area: parser L-JavaScript Language: JavaScript and super languages labels Dec 5, 2023
@Conaclos Conaclos merged commit 53afe06 into biomejs:main Dec 5, 2023
16 checks passed
@Conaclos
Copy link
Member

Conaclos commented Dec 5, 2023

@suxin2017 This seems still triggered for overloads: Playground linlk

@suxin2017
Copy link
Contributor Author

@suxin2017 This seems still triggered for overloads: Playground linlk

Let me follow up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Parser Area: parser L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Spurious "Illegal duplicate default export declarations" with exported value and type
2 participants