micromark / micromark-extension-gfm-strikethrough

micromark extension to support GFM strikethrough
https://unifiedjs.com
MIT License
3 stars 5 forks source link

Typescript compilation with latest version #3

Closed nouman91 closed 1 year ago

nouman91 commented 1 year ago

Initial checklist

Affected packages and versions

1.0.7

Link to runnable example

No response

Steps to reproduce

Install the latest version

Expected behavior

It should run fine there should not be any issues while building the project

Actual behavior

I had some dependency issues so I deleted the yarn.lock file and re-installed everything, but some of the packages depend internally on this package, and since deleting yarn.lock file caused the internal packages to go to the latest version in this case from 1.0.1 to 1.0.7 and it started to fail the build of the project. Here are the errors I am getting.

"../../node_modules/micromark-extension-gfm-footnote/index.d.ts(5,8): error TS1005: ',' expected.\n" +
    "../../node_modules/micromark-extension-gfm-footnote/index.d.ts(6,8): error TS1005: ',' expected.\n" +
    "../../node_modules/micromark-extension-gfm-strikethrough/index.d.ts(2,32): error TS1005: ',' expected

While I know this is a bit cryptic but since you released the 1.0.7 just today can you check why its happening?

The dependency which is causing the issue: remark-gfm@3.0.1#micromark-extension-gfm@2.0.3#micromark-extension-gfm-strikethrough@1.0.7

Runtime

Node v14

Package manager

yarn v1

OS

macOS

Build and bundle tools

Webpack

wooorm commented 1 year ago

My guess is you have an ancient typescript version. What's it? Please update that

nouman91 commented 1 year ago

I have fairly latest one, I am using 4.2.4

ChristianMurphy commented 1 year ago

Latest TypeScript is version 5

nouman91 commented 1 year ago

Yeah, I know and I am not saying I have the latest one I am saying I have the fairly latest one. @wooorm which version should I be using if 4.2.4 is not compatible?

ChristianMurphy commented 1 year ago

I understand you now. I was getting confused by the use of "fairly latest" which is a contradiction. "latest" is only the most recent, "fairly" is not the most recent.

version should I be using if 4.2.4 is not compatible?

This package, and most of unified is tested against TypeScript 5, try that first. https://github.com/micromark/micromark-extension-gfm-strikethrough/blob/b8c00a3164ee6e0dbadf65e8e14f6137e0345a07/package.json#L62

That said, the specific feature you are seeing an error on was added in TypeScript 4.5 https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names You could upgrade to that, if you aren't ready to use the latest major of TS.

ChristianMurphy commented 1 year ago

Adding on, TypeScript 4.5 was release 2 years ago https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/ TypeScript 4.2 is rather outdated.

remcohaszing commented 1 year ago

I think it’s good to follow the DefinitelyTyped support window of 2 years. TypeScript 4.3 is being dropped this month.

nouman91 commented 1 year ago

Thank you, guys, thank you @ChristianMurphy I upgraded to typescript version 4.5.5 it fixed my problem, but now onto fixing material-ui issues :(

github-actions[bot] commented 1 year ago

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] commented 1 year ago

Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.

See our support docs for how and where to ask questions.

Thanks, — bb