Closed jaswrks closed 7 months ago
Latest commit: a4295383d2f91d6b947de201bcd906f5a57b8a1d
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
File | Before | After |
---|---|---|
Total (Includes all files) | 1.3 MB |
1.3 MB |
Tarball size | 131.6 kB |
131.6 kB |
🤖 This report was automatically generated by pkg-size-action
CI broken, it seems more changes are required, I'll take a look tomorrow.
@wooorm Any advice about how to migrate like Root
from remark-mdx
?
Any advice about how to migrate like Root from remark-mdx?
@JounQin have you tried Root
from mdast
?
The one in remark-mdx was likely an alias for the one in mdast which was accidentally exported.
Any advice about how to migrate like Root from remark-mdx?
@JounQin have you tried
Root
frommdast
? The one in remark-mdx was likely an alias for the one in mdast which was accidentally exported.
@ChristianMurphy
It won't work because we need the followings:
@JounQin it will work if mdast-util-mdx-expression
is included in the ambient types.
See https://www.npmjs.com/package/mdast-util-mdx-expression/v/2.0.0?activeTab=code index.d.ts at around line 120. It registers the new types on to the root element.
This is how all the mdast parsers register new content types, using content maps, which can be automatically extended parsers so that mdast
includes the new child types.
See also the readmes, e.g.: https://mdxjs.com/packages/remark-mdx/#types
OK, it seems we need:
/// <reference types="remark-mdx" />
import type { Root } from 'mdast'
I'll try it this night. (Previously, I'm not aware that referencing remark-mdx
is required).
packages/eslint-mdx/src/tokens.ts:47:7 - error TS2367: This comparison appears to be unintentional because the types '"root" | "paragraph" | "heading" | "thematicBreak" | "blockquote" | "list" | "table" | "html" | "code" | "yaml" | "definition" | "footnoteDefinition" | "listItem" | "tableRow" | ... 12 more ... | "footnoteReference"' and '"mdxFlowExpression"' have no overlap.
47 node.type !== 'mdxFlowExpression' &&
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I'm still seeing this... @ChristianMurphy @wooorm
I tried:
/// <reference types="remark-mdx" />
import type { Root } from 'mdast'
Or
/// <reference types="mdast-util-mdx-expression" />
import type { Root } from 'mdast'
You are missing @types/mdast
as a dependency, and in the last example mdast-util-mdx-expression
.
Make sure to specify all the types you include as dependencies, otherwise yarn will fail / pick old versions that don’t work together.
@wooorm There are some remark-lint
plugins are still requiring @types/mdast@v3
like remark-lint-file-extension
which has not been upgraded yet.
Correct
@JounQin Thank you. I've smoke tested this just a bit. Seems to do the trick.
./package.json
for each of the two packages.Configuration
import fromunified-engine
.Thanks in advance for anyone able to have a look at this with more experienced eyes than mine.
close #480