Skip to content

Commit eef0d97

Browse files
feat: switch from deprecated eslint-plugin-markdown to @eslint/markdown (#2297)
## PR Checklist - [x] Addresses an existing open issue: fixes #2273 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview Swaps in-place from the old plugin to the new. This isn't _quite_ what the issue suggested, but I plan on sending a fast follow for the more full #1926 to migrate off of Markdownlint. I think it'll be nice to have a reference version of CTA that uses `@eslint/markdown` instead of `eslint-plugin-markdown` _before_ the removal of Markdownlint. Just in case it's useful. 🎁
1 parent 480a869 commit eef0d97

File tree

6 files changed

+325
-128
lines changed

6 files changed

+325
-128
lines changed

docs/FAQs.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ Then:
108108
1. In `tsdown.config.ts`, change the [tsdown `format` option](https://tsdown.dev/options/output-format) from `["esm"]` to `["cjs", "esm"]`
109109
2. Add a [`package.json` `"exports"` entry](https://nodejs.org/api/packages.html#subpath-exports) like:
110110

111-
<!-- eslint-disable jsonc/sort-keys -->
112-
113111
```json package.json
114112
{
115113
"exports": {
@@ -125,8 +123,6 @@ Then:
125123
}
126124
```
127125

128-
<!-- eslint-enable jsonc/sort-keys -->
129-
130126
That should be it!
131127

132128
To be safe, consider checking with [arethetypeswrong](https://arethetypeswrong.github.io):

eslint.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ If you're interested in learning more, see the 'getting started' docs on:
1010

1111
import comments from "@eslint-community/eslint-plugin-eslint-comments/configs";
1212
import eslint from "@eslint/js";
13+
import markdown from "@eslint/markdown";
1314
import vitest from "@vitest/eslint-plugin";
1415
import jsdoc from "eslint-plugin-jsdoc";
1516
import jsonc from "eslint-plugin-jsonc";
16-
import markdown from "eslint-plugin-markdown";
1717
import n from "eslint-plugin-n";
1818
import packageJson from "eslint-plugin-package-json";
1919
import perfectionist from "eslint-plugin-perfectionist";
@@ -82,7 +82,14 @@ export default defineConfig(
8282
extends: [jsonc.configs["flat/recommended-with-json"]],
8383
files: ["**/*.json"],
8484
},
85-
{ extends: [markdown.configs.recommended], files: ["**/*.md"] },
85+
{
86+
extends: [markdown.configs.recommended],
87+
files: ["**/*.md"],
88+
rules: {
89+
// https://github.com/eslint/markdown/issues/294
90+
"markdown/no-missing-label-refs": "off",
91+
},
92+
},
8693
{
8794
extends: [tseslint.configs.disableTypeChecked],
8895
files: ["**/*.md/*.ts"],

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
"devDependencies": {
7272
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
7373
"@eslint/js": "9.39.1",
74+
"@eslint/markdown": "7.5.1",
7475
"@prettier/sync": "0.6.1",
7576
"@release-it/conventional-changelog": "10.0.2",
76-
"@types/eslint-plugin-markdown": "2.0.2",
7777
"@types/html-to-text": "9.0.4",
7878
"@types/js-yaml": "4.0.9",
7979
"@types/lodash": "4.17.21",
@@ -91,7 +91,6 @@
9191
"eslint": "9.39.1",
9292
"eslint-plugin-jsdoc": "61.4.1",
9393
"eslint-plugin-jsonc": "2.21.0",
94-
"eslint-plugin-markdown": "5.1.0",
9594
"eslint-plugin-n": "17.23.1",
9695
"eslint-plugin-package-json": "0.85.0",
9796
"eslint-plugin-perfectionist": "4.15.1",

0 commit comments

Comments
 (0)