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 superfluous triple-slash declarations #565

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

machty
Copy link
Owner

@machty machty commented Feb 9, 2024

Attempt to fix #564

Currently running into issues with jscodeshift/babel failing to parse export const foo = ... in .d.ts files in declaration.

cc @NullVoxPopuli

@machty machty changed the title First attempt, with parser errors Fix superfluous triple-slash declarations Feb 9, 2024
@NullVoxPopuli
Copy link
Sponsor

NullVoxPopuli commented Feb 9, 2024

I was able to easily reproduce the issue you mentioned in discord in the test suite.

Here is what the tests look like to see how to test this sort of stuff NullVoxPopuli/fix-bad-declaration-output#10

it seems this is the issue: facebook/jscodeshift#539

@NullVoxPopuli
Copy link
Sponsor

NullVoxPopuli commented Feb 9, 2024

after some more digging, it seems the types are wrong -- how are they generated?

a d.ts file should have declare if a const is not going to have an initializer.

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