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

Improve TypeScript config #180

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Improve TypeScript config #180

merged 1 commit into from
Oct 4, 2023

Conversation

valtlai
Copy link
Contributor

@valtlai valtlai commented Oct 2, 2023

  • Upgrades to the latest, major TypeScript version
  • Removes the unused, extra types file

TSConfig:

  • Updates target and module to modern but Node.js 18 compatible values
  • Removes the following options:
    • esModuleInterop and allowSyntheticDefaultImports (which have default values)
    • moduleResolution (which conflicts with "module": "nodenext", and whose default value is taken from module)
    • checkJs (because there are no .js files, only .ts ones)
    • exclude (because the listed directories are not inside include and thus not included by default)
  • Simplifies the include list to use just the source directory

- Upgrades to the latest, major TypeScript version

- Removes the unused, extra types file

TSConfig:

- Updates `target` and `module` to modern
  but Node.js 16 compatible values

- Removes the following options:

  - `esModuleInterop` and `allowSyntheticDefaultImports`
    (which have default values)

  - `moduleResolution` (which conflicts with "module": "nodenext",
    and whose default value is taken from `module`)

  - `checkJs` (because there are no .js files, only .ts ones)

  - `exclude` (because the listed directories are not inside `include`
    and thus not included by default)

- Simplifies the `include` list to just use the source directory
Copy link
Contributor

@valju valju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! And this is fixing something I had troubles two weeks ago, when trying to make Knex work fully TypeScript. Nice to hear fix arrives.

@valju
Copy link
Contributor

valju commented Oct 4, 2023

How did the Knex people do, they have an update for this? Is this already final? When should we accept this?

@valtlai
Copy link
Contributor Author

valtlai commented Oct 4, 2023

They have an update, yeah, but it’s not released yet. I don’t know when it will happen. Let’s merge this now, and I’ll open a new PR later once the new Knex version is available.

@valju valju merged commit b1fe80f into main Oct 4, 2023
@valju valju deleted the typescript branch October 4, 2023 11:40
valtlai added a commit that referenced this pull request Oct 6, 2023
Removes the workaround introduced in #180.
@valtlai valtlai mentioned this pull request Oct 6, 2023
valtlai added a commit that referenced this pull request Oct 6, 2023
Removes the workaround introduced in #180.
@valtlai valtlai mentioned this pull request Oct 6, 2023
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