Skip to content

Commit

Permalink
feat!: bump with mdast-util-from-markdown with synckit
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Apr 19, 2024
1 parent 00adccb commit 9e6fa95
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
13 changes: 12 additions & 1 deletion eslint.config.js
Expand Up @@ -3,8 +3,19 @@
module.exports = [
...require("eslint-config-eslint/cjs").map(config => ({
...config,
files: ["**/*.js"]
files: ["**/*.js", "**/*.mjs"]
})),
{
files: ["**/*.mjs"],
languageOptions: {
sourceType: "module",
parserOptions: {
ecmaFeatures: {
impliedStrict: true
}
}
}
},
{
plugins: {
markdown: require(".")
Expand Down
5 changes: 4 additions & 1 deletion lib/processor.js
Expand Up @@ -27,9 +27,12 @@

"use strict";

const parse = require("mdast-util-from-markdown");
const { createSyncFn } = require("synckit");

const pkg = require("../package.json");

const parse = createSyncFn(require.resolve("./worker.mjs"));

const UNSATISFIABLE_RULES = new Set([
"eol-last", // The Markdown parser strips trailing newlines in code fences
"unicode-bom" // Code blocks will begin in the middle of Markdown files
Expand Down
4 changes: 4 additions & 0 deletions lib/worker.mjs
@@ -0,0 +1,4 @@
import { fromMarkdown } from "mdast-util-from-markdown";
import { runAsWorker } from "synckit";

runAsWorker(fromMarkdown);
6 changes: 4 additions & 2 deletions package.json
Expand Up @@ -33,7 +33,8 @@
"files": [
"index.js",
"lib/index.js",
"lib/processor.js"
"lib/processor.js",
"lib/worker.mjs"
],
"devDependencies": {
"@eslint/js": "^8.56.0",
Expand All @@ -46,7 +47,8 @@
"nyc": "^14.1.1"
},
"dependencies": {
"mdast-util-from-markdown": "^0.8.5"
"mdast-util-from-markdown": "^2.0.0",
"synckit": "^0.9.0"
},
"peerDependencies": {
"eslint": ">=8"
Expand Down

0 comments on commit 9e6fa95

Please sign in to comment.