-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Migration to TypeScript for specs #44
Conversation
I've added The specs now compile to the The new command to "lint" the specs is You can take a look at how to write specs in TS with the types here: 3b3d751#diff-6f6f4fc563a4439827032c3278ba487e9d4fa6c24a7ec4c6e41ca21005c726f4 Has you can see, it's very simple:
And now you will get auto-completion and errors warning, thanks to the added type I've also make sure that the existing JS specs still work great, along with added support to new/migrated specs in TS. |
The generated specs written TS are not working in fig: I found that changing the name of the spec (initially to var cd = {
name: "cd",
description: "Change the shell working directory",
args: {
template: "folders"
}
}; After setting the name back to var completionSpec = {
name: "cd",
description: "Change the shell working directory",
args: {
template: "folders"
}
}; We have two solutions:
EDIT EDIT |
Co-authored-by: Tim Raderschad <tim.raderschad@gmail.com>
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
As in #43, I started a PR to add TypeScript support to Fig.
What is the current behavior? (You can also link to an open issue here)
Hard to write error-prone specs without IDEs auto-completion.
What is the new behavior (if this is a feature change)?
Provide types for the specs, allowing for awesome auto-completion and faster development of new specs.
Additional info:
I'm still working on it, so expect type bugs for now.