Skip to content

refactor: Added consistent-type-imports eslint rule and ran --fix#2230

Merged
bmingles merged 4 commits intodeephaven:mainfrom
bmingles:2229-consistent-type-imports
Sep 20, 2024
Merged

refactor: Added consistent-type-imports eslint rule and ran --fix#2230
bmingles merged 4 commits intodeephaven:mainfrom
bmingles:2229-consistent-type-imports

Conversation

@bmingles
Copy link
Copy Markdown
Contributor

@bmingles bmingles commented Sep 19, 2024

  • Added @typescript-eslint/consistent-type-imports linting rule
  • Added package script lint:packages
  • Ran npm run lint:packages -- --fix

Note: despite the crazy large number of files, most of these were changed automatically by eslint --fix, so should be able to skim provided all automated tests pass.

resolves #2229

BREAKING CHANGE: eslint rule will require type only imports where possible

@bmingles bmingles requested review from a team and dgodinez-dh and removed request for a team September 19, 2024 23:00
@mattrunyon
Copy link
Copy Markdown
Collaborator

Can you update the rule to prefer inline-type-imports? It should remove a bunch of the duplicated imports just for types. TS 4.5+ added so you can do import { a, type b } from 'c';. Might reduce the number of files too since we do this in a bunch of places

@bmingles bmingles force-pushed the 2229-consistent-type-imports branch from bd98271 to ba75eb2 Compare September 19, 2024 23:17
@bmingles
Copy link
Copy Markdown
Contributor Author

Can you update the rule to prefer inline-type-imports? It should remove a bunch of the duplicated imports just for types. TS 4.5+ added so you can do import { a, type b } from 'c';. Might reduce the number of files too since we do this in a bunch of places

Done. Good call

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 46.61%. Comparing base (96e3d43) to head (ba75eb2).

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2230    +/-   ##
========================================
  Coverage   46.61%   46.61%            
========================================
  Files         692      692            
  Lines       38508    38508            
  Branches     9619     9826   +207     
========================================
  Hits        17949    17949            
+ Misses      20548    20506    -42     
- Partials       11       53    +42     
Flag Coverage Δ
unit 46.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bmingles bmingles merged commit 2744f97 into deephaven:main Sep 20, 2024
@bmingles bmingles deleted the 2229-consistent-type-imports branch September 20, 2024 13:43
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eslint rule: @typescript-eslint/consistent-type-imports

3 participants