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

feat: support typescript linting and type checking #474

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

Conversation

kabaros
Copy link
Contributor

@kabaros kabaros commented Oct 18, 2024

This PR adds support to linting and type checking typescript projects.

Notes:

  1. As part of this, I upgraded eslint to v8. This is not the latest, the latest v9 requires a new structure for eslint configs, and would mean that we'd have to pass a flag to use the old config in our projects. I plan to write an RFC for the next steps for the configs (proposing to use shared configs and using the CLI tool only as a helper for installing these configs) and I will look at upgrading eslint to v9 as part of that.

  2. I added a check to run tsc --noEmit to do a type check on Typescript projects - this is an implicit test that runs wheneever it seems a tsconfig.json in the root of the project. I think that if a consumer is using TS then they should make sure it compiles, they're free to disable rules or change the config, but it should always compile.

  3. For this to work without a module resolution, we also need to bump this outdated version of TS in app-shell: fix: bump typescript version used in app shell app-platform#885

  4. Right now, it shows the below warnning since hte eslint plugin was not updated to support the latest version of TS but that's not an issue
    image

Testing

I tested this works with route-manager-app (TS), data-entry-beta (JS), data-visualiser (JS), maintenance-app-beta (TS)

Followups:

  • update Typescript template in app-platform@alpha to use this config

implements https://dhis2.atlassian.net/browse/LIBS-696

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

Successfully merging this pull request may close these issues.

1 participant