Closed captbaritone closed 9 months ago
Name | Link |
---|---|
Latest commit | 21965a3f568cab4eaa70bbe5fa085e7961ea0303 |
Latest deploy log | https://app.netlify.com/sites/grats/deploys/65b089c543e60b00082e0d38 |
Deploy Preview | https://deploy-preview-114--grats.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
TypeScript lets you specify a plugin in your typescript config which can add additional functionality in the editor. This is a good fit for Grats which is built around the TypeScript compiler and could report helpful errors.
I'm still working to figure out a way to efficiently (re)compute cross-file validations, but this should give us a start by reporting syntax-only issues.
Ideally we could specify
grats
as the plugin itself, but from what I can tell TypeScript's requirements around the way the plugin is invoked are going to be hard to get to work inside thegrats
module itself:We could still explore having grats expose both a commonjs and ES Module version and have the commonjs version export the initi funciton with all the actual exports as properties on the function, but that's getting pretty crazy.
Since the logic of the plugin will be tightly coupled with Grats, I'm having the plugin extension just re-export the actual implementation from the grats module.
Example
https://github.com/captbaritone/grats/assets/162735/4d57481e-e559-472e-b5a6-5799a609cb89
Setup
Add the plugin to your tsconfig
Configure VSCode to use your local version of TypeScript. Via
CMD+P
"TypeScript: Select TypeScript Version..." with a .ts file open or a.vscode/settings.json
for your project with: