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

Stricter type checking / IntelliSense #117

Closed
claytercek opened this issue Aug 23, 2023 · 2 comments · Fixed by #129
Closed

Stricter type checking / IntelliSense #117

claytercek opened this issue Aug 23, 2023 · 2 comments · Fixed by #129

Comments

@claytercek
Copy link
Member

Mentioned in our plugin API discussion (#114)

One of the large benefits of moving to JS configs instead of JSON is intelliSense, but launchpad is not currently equipped to take advantage of that. The JS Language service looks for typescript declaration files (.d.ts) for intellisense in most IDEs, but because launchpad is written in JS, no declaration files are being generated.

What we can do is add a tsconfig.json file to each of the launchpad package directories, and configure them with the following options:

{
  // ...
  "compilerOptions": {
    // ...
    "allowJs": true,
    "checkJs": true,
    "declaration": true,
    "emitDeclarationOnly": true,
    // ...
  },
  "include": ["**/*.js"]
  // ...
}

Then add a tsc step to the changeset publish action. This will run the ts type-checker on our js + jsdoc, generating declaration files and publishing them alongside the js to npm.

This also has the added benefit of more thorough type checking across the board.

@claytercek claytercek changed the title Stricter typing / IntelliSense Stricter type checking / IntelliSense Aug 23, 2023
@benjaminbojko
Copy link
Collaborator

benjaminbojko commented Aug 24, 2023

Love this idea! I was wondering a few times what it would take to generate these. Might also help with private vs public functions down the road, right?

Seems like a pretty low-hanging fruit feature to try out as. Marking it as medium high priority.

@claytercek
Copy link
Member Author

Strict type checking has been added with PR #118, breaking config intellisense into a separate ticket

@claytercek claytercek linked a pull request Sep 19, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants