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

Update supported typescript version #943

Merged
merged 3 commits into from
Sep 22, 2021
Merged

Conversation

prsdta
Copy link
Contributor

@prsdta prsdta commented Sep 15, 2021

Why

We want to be able to use frolint with more recent versions of TS.
ref #876

To follow typescript-eslint's compatibility, after latest update in b2bcf66

Reference info:
https://github.com/typescript-eslint/typescript-eslint/tree/v4.31.1#supported-typescript-version

What

Update typescript-eslint to the latest version. Update the typescript dependency to the link above.
Also fixed a few type errors in the code caused by the update.

@github-actions github-actions bot added eslint-config-wantedly-typescript https://www.npmjs.com/package/eslint-config-wantedly-typescript repo Root directory of this project labels Sep 15, 2021
@prsdta prsdta changed the title update typescript version WIP update typescript version Sep 15, 2021
@github-actions github-actions bot added the frolint https://www.npmjs.com/package/frolint label Sep 16, 2021
@prsdta prsdta marked this pull request as ready for review September 22, 2021 07:24
@prsdta prsdta changed the title WIP update typescript version Update supported typescript version Sep 22, 2021
@prsdta prsdta requested a review from qnighy September 22, 2021 07:24
yarn.lock Outdated
Comment on lines 1680 to 1692
"@typescript-eslint/experimental-utils@4.31.1":
version "4.31.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.1.tgz#0c900f832f270b88e13e51753647b02d08371ce5"
integrity sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==
dependencies:
"@types/json-schema" "^7.0.7"
"@typescript-eslint/scope-manager" "4.31.1"
"@typescript-eslint/types" "4.31.1"
"@typescript-eslint/typescript-estree" "4.31.1"
eslint-scope "^5.1.1"
eslint-utils "^3.0.0"

"@typescript-eslint/experimental-utils@^4.0.1":
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be deduplicated

packages/frolint/src/utils/isInstanceOfNodeError.ts Outdated Show resolved Hide resolved
packages/frolint/src/utils/isInstanceOfNodeError.ts Outdated Show resolved Hide resolved
Typescript's stdlib only has the Error type from the browser, when
Node.js actually uses an Error type with more properties.
To avoid type errors, we use a type assertion inspired from
https://dev.to/jdbar/the-problem-with-handling-node-js-errors-in-typescript-and-the-workaround-m64

Note: had to add a `globals` comment, since Eslint's `no-undef` rule
does not handle the Noje.js global types.
@prsdta
Copy link
Contributor Author

prsdta commented Sep 22, 2021

Did a bit too much thinking for nothing on this one, it should be much simpler like this.

@prsdta prsdta requested a review from qnighy September 22, 2021 09:34
Copy link
Contributor

@qnighy qnighy left a comment

Choose a reason for hiding this comment

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

Could you rerun yarn install to regenerate yarn.lock? Otherwise it looks all good!

@prsdta
Copy link
Contributor Author

prsdta commented Sep 22, 2021

Argh, not very used to this deduplicating schenanigans yet. Thanks!

@prsdta prsdta merged commit e159c55 into master Sep 22, 2021
@prsdta prsdta deleted the prsdta/update-typescript branch September 22, 2021 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eslint-config-wantedly-typescript https://www.npmjs.com/package/eslint-config-wantedly-typescript frolint https://www.npmjs.com/package/frolint repo Root directory of this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants