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

Add Support for MDX v3 #481

Closed
wants to merge 10 commits into from
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@
"@changesets/cli": "^2.26.2",
"@types/eslint": "^8.44.1",
"@types/eslint-plugin-markdown": "^2.0.0",
"@types/jest": "^29.5.3",
"@types/jest": "^29.5.7",
"@types/node": "^20.4.6",
"@types/react": "^18.2.18",
"@types/unist": "^2.0.6",
"jest": "^29.6.2",
"@types/react": "^18.2.23",
"@types/unist": "^2.0.8",
"jest": "^29.7.0",
"patch-package": "^8.0.0",
"react": "^18.2.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"type-coverage": "^2.26.0",
"type-coverage": "^2.27.0",
"typescript": "^5.1.6",
"yarn-deduplicate": "^6.0.2"
},
Expand Down
20 changes: 10 additions & 10 deletions packages/eslint-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
"eslint": ">=8.0.0"
},
"dependencies": {
"acorn": "^8.10.0",
"acorn": "^8.11.2",
"acorn-jsx": "^5.3.2",
"espree": "^9.6.1",
"estree-util-visit": "^1.2.1",
"remark-mdx": "^2.3.0",
"remark-parse": "^10.0.2",
"remark-stringify": "^10.0.3",
"estree-util-visit": "^2.0.0",
"remark-mdx": "^3.0.0",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"synckit": "^0.8.5",
"tslib": "^2.6.1",
"unified": "^10.1.2",
"unified-engine": "^10.1.0",
"unist-util-visit": "^4.1.2",
"tslib": "^2.6.2",
"unified": "^11.0.4",
"unified-engine": "^11.1.1",
"unist-util-visit": "^5.0.0",
"uvu": "^0.5.6",
"vfile": "^5.3.7"
"vfile": "^6.0.1"
}
}
4 changes: 2 additions & 2 deletions packages/eslint-mdx/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
Literal as MdastLiteral,
} from 'mdast'
import type { Options } from 'micromark-extension-mdx-expression'
import type { Root } from 'remark-mdx'

Check failure on line 32 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 16 on ubuntu-latest

Module '"remark-mdx"' has no exported member 'Root'. Did you mean to use 'import Root from "remark-mdx"' instead?

Check failure on line 32 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 18 on ubuntu-latest

Module '"remark-mdx"' has no exported member 'Root'. Did you mean to use 'import Root from "remark-mdx"' instead?

Check failure on line 32 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 on ubuntu-latest

Module '"remark-mdx"' has no exported member 'Root'. Did you mean to use 'import Root from "remark-mdx"' instead?
import { extractProperties, runAsWorker } from 'synckit'
import type { FrozenProcessor } from 'unified'

Check failure on line 34 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 16 on ubuntu-latest

Module '"unified"' has no exported member 'FrozenProcessor'.

Check failure on line 34 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 18 on ubuntu-latest

Module '"unified"' has no exported member 'FrozenProcessor'.

Check failure on line 34 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 on ubuntu-latest

Module '"unified"' has no exported member 'FrozenProcessor'.
import type { Config, Configuration } from 'unified-engine/lib/configuration'

Check failure on line 35 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 16 on ubuntu-latest

Module '"unified-engine/lib/configuration"' has no exported member 'Config'.

Check failure on line 35 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 18 on ubuntu-latest

Module '"unified-engine/lib/configuration"' has no exported member 'Config'.

Check failure on line 35 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 on ubuntu-latest

Module '"unified-engine/lib/configuration"' has no exported member 'Config'.
import type { Node } from 'unist'
import { ok as assert } from 'uvu/assert'
import type { VFileMessage } from 'vfile-message'
Expand Down Expand Up @@ -65,8 +65,8 @@
const getRemarkConfig = async (searchFrom: string) => {
if (!config) {
const { Configuration } = await loadEsmModule<
typeof import('unified-engine/lib/configuration')
>('unified-engine/lib/configuration.js')
typeof import('unified-engine')
>('unified-engine')
config = new Configuration({
cwd: process.cwd(),
packageField: 'remarkConfig',
Expand All @@ -78,19 +78,19 @@

return new Promise<Config>((resolve, reject) =>
config.load(searchFrom, (error, result) =>
error ? reject(error) : resolve(result),

Check failure on line 81 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 16 on ubuntu-latest

Type 'void' is not assignable to type 'undefined'.

Check failure on line 81 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 18 on ubuntu-latest

Type 'void' is not assignable to type 'undefined'.

Check failure on line 81 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 on ubuntu-latest

Type 'void' is not assignable to type 'undefined'.
),
)
}

const getRemarkMdxOptions = (tokens: Token[]): Options => ({
acorn: acornParser,

Check failure on line 87 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 16 on ubuntu-latest

Type 'typeof Parser' is not assignable to type 'Acorn'.

Check failure on line 87 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 18 on ubuntu-latest

Type 'typeof Parser' is not assignable to type 'Acorn'.

Check failure on line 87 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 on ubuntu-latest

Type 'typeof Parser' is not assignable to type 'Acorn'.
acornOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
locations: true,
ranges: true,
onToken: tokens,

Check failure on line 93 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 16 on ubuntu-latest

Type 'Token[]' is not assignable to type '((token: Token) => any) | Token[]'.

Check failure on line 93 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 18 on ubuntu-latest

Type 'Token[]' is not assignable to type '((token: Token) => any) | Token[]'.

Check failure on line 93 in packages/eslint-mdx/src/worker.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 on ubuntu-latest

Type 'Token[]' is not assignable to type '((token: Token) => any) | Token[]'.
},
})

Expand Down
12 changes: 6 additions & 6 deletions packages/eslint-plugin-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"dependencies": {
"eslint-mdx": "^2.2.0",
"eslint-plugin-markdown": "^3.0.1",
"remark-mdx": "^2.3.0",
"remark-parse": "^10.0.2",
"remark-stringify": "^10.0.3",
"tslib": "^2.6.1",
"unified": "^10.1.2",
"vfile": "^5.3.7"
"remark-mdx": "^3.0.0",
"remark-parse": "^11.0.0",
"remark-stringify": "^11.0.0",
"tslib": "^2.6.2",
"unified": "^11.0.4",
"vfile": "^6.0.1"
}
}
Loading
Loading