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

refactor: resolve small eslint rules and TS settings #2073

Merged
merged 11 commits into from
Jun 19, 2023

Conversation

wellwelwel
Copy link
Collaborator

@wellwelwel wellwelwel commented Jun 18, 2023

About 1,209 additions and 1,791 deletions:

  • Around -904 is because package-lock.json by removing unused dependencies
  • Around +1,184 and −735 it's just the indentation: 2 from ESLint and printWith: 80 from Prettier

In practice, around 35 additions and 126 deletions were "really" made.


In this refacoring task:

No types were changed in this PR except for ban-types
See ab0de35

  • Resolve the following eslint rules:
    • indent
    • no-mixed-spaces-and-tabs
    • @typescript-eslint/no-unused-vars
    • @typescript-eslint/ban-types *

Unfortunately, the ban-types resolution for Connection and PoolConnection will need to be resolved together with joining the spread types.


  • Remove unused TS tests
  • Remove unused dependencies
    • @types/mocha, @types/chai, mocha and chai dependencies

  • Redefine the tsconfig.json
    • Include index.d.ts, promise.d.ts and the typings folder
    • Remove "strictFunctionTypes": false

An easy way to review it, is looking for commits:

  • 8f7445e (redefine TypeScript settings)
  • ae2f98f (remove unused type tests)
  • ab0de35 (resolve eslint ban-types)
  • 744a49e (rollback eslint ban-types for Connection and PoolConnection)
  • etc.

And finally:

  • 57770aa (resolve small eslint rules)
    • indentation and printWidth 👻

See more in #2072

@wellwelwel
Copy link
Collaborator Author

@sidorares, is it okay if I merge the refactoring up to the point where no types are actually changed?

Then I would stop at the main change, which would be the joining the spread types and wait for an accurate review.

My intention is not to take up too much of your time, it's okay if you can't see it now or just say to wait 🙋🏻‍♂️

I want to gradually fix all the #2072 missing and wrong types (if someone proposes first, that would be great).
These refactoring would help make these fixes easier.

@sidorares
Copy link
Owner

go for it @wellwelwel

@wellwelwel
Copy link
Collaborator Author

@sidorares, it's done. So far, no type has changed 🤹🏻‍♀️

Now, I will create a separate PR for the last two refactoring tasks:

  • Join spread out types
  • Create a reusable way for query and execute overloads

@wellwelwel wellwelwel merged commit d4f3692 into sidorares:master Jun 19, 2023
34 checks passed
@wellwelwel wellwelwel deleted the refactor-ts-1 branch June 24, 2023 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants