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

(chore) Enforce consistent usage of type imports #242

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

denniskigen
Copy link
Member

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

This PR amends the ESLint config used in this project to enforce consistent type imports. TypeScript allows specifying a type keyword on imports to indicate that the export exists only in the type system, not at runtime. This allows transpilers to drop imports without knowing the types of the dependencies. This offers some build optimization as the compiler can skip type-only imports more efficiently during transpilation. Additionally, using explicit type imports helps bundlers and tree-shaking tools to identify and eliminate unused code more easily.

Screenshots

Related Issue

Other

Copy link

Size Change: 0 B

Total Size: 1.13 MB

ℹ️ View Unchanged
Filename Size
dist/17.js 16.6 kB
dist/184.js 11.2 kB
dist/225.js 2.57 kB
dist/29.js 206 kB
dist/300.js 592 B
dist/327.js 1.59 kB
dist/335.js 958 B
dist/353.js 3.02 kB
dist/41.js 3.36 kB
dist/422.js 3.03 kB
dist/439.js 6.24 kB
dist/505.js 7.46 kB
dist/522.js 240 kB
dist/540.js 2.63 kB
dist/55.js 752 B
dist/569.js 2.5 kB
dist/581.js 203 kB
dist/606.js 2.23 kB
dist/635.js 14.2 kB
dist/767.js 79.1 kB
dist/886.js 6.94 kB
dist/942.js 482 B
dist/99.js 692 B
dist/993.js 3.08 kB
dist/main.js 312 kB
dist/openmrs-form-engine-lib.js 3.81 kB

compressed-size-action

@samuelmale samuelmale merged commit 8eaf246 into main Apr 29, 2024
4 checks passed
@samuelmale samuelmale deleted the chore/consistent-type-imports branch April 29, 2024 09:35
usamaidrsk pushed a commit to usamaidrsk/openmrs-form-engine-lib that referenced this pull request Apr 29, 2024
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.

2 participants