Repository navigation
fix: support markdown-it v15 types alongside v13/v14 - #11
Open
ArcticLampyrid wants to merge 1 commit into
Open
ArcticLampyrid wants to merge 1 commit into
ArcticLampyrid wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
markdown-itv15 ships built-in TypeScript declarations and no longer exportsPluginWithOptions(which came from@types/markdown-it). As a result, consumers usingmarkdown-itv15 encounter a type error when importingmarkdown-it-github-alerts.This PR updates the plugin type signature to use
InstanceType<typeof MarkdownIt>from the defaultmarkdown-itimport instead ofPluginWithOptions:markdown-itv15 (built-in types, where the default export is a callable constructor value andPluginWithOptionsis absent).markdown-itv13 and v14 (@types/markdown-it).tokens[idx].metasosrc/index.tsalso typechecks undermarkdown-itv15's stricterToken.metatype (Record<string, unknown> | null).Verification
pnpm lint,pnpm typecheck,pnpm build, andpnpm testin this repository.dist/index.d.mtswithtsc --noEmit --strict --skipLibCheck falseunder bothmoduleResolution: "bundler"and"nodenext"across:markdown-it@15.0.3(no@types/markdown-it)markdown-it@14.1.0+@types/markdown-it@14.1.2markdown-it@14.1.0+@types/markdown-it@14.2.0markdown-it@13.0.2+@types/markdown-it@13.0.9