Compare commits

..

No commits in common. "develop" and "v4.0.0" have entirely different histories.

9 changed files with 812 additions and 1870 deletions

11
.markdownlint-cli2.jsonc Normal file
View File

@ -0,0 +1,11 @@
{
"config": {
"extends": "markdownlint/style/prettier",
"default": true,
"relative-links": true,
"no-inline-html": false,
},
"globs": ["**/*.md"],
"ignores": ["**/node_modules", "**/test/fixtures/**"],
"customRules": ["./src/index.js"],
}

View File

@ -1,15 +0,0 @@
import relativeLinksRule from "./src/index.js"
const config = {
config: {
extends: "markdownlint/style/prettier",
default: true,
"relative-links": true,
"no-inline-html": false,
},
globs: ["**/*.md"],
ignores: ["**/node_modules", "**/test/fixtures/**"],
customRules: [relativeLinksRule],
}
export default config

View File

@ -80,22 +80,18 @@ There are various ways [markdownlint](https://github.com/DavidAnson/markdownlint
We recommend configuring [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) over [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) for compatibility with the [vscode-markdownlint](https://github.com/DavidAnson/vscode-markdownlint) extension. We recommend configuring [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2) over [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli) for compatibility with the [vscode-markdownlint](https://github.com/DavidAnson/vscode-markdownlint) extension.
`.markdownlint-cli2.mjs` `.markdownlint-cli2.jsonc`
```js ```json
import relativeLinksRule from "markdownlint-rule-relative-links" {
"config": {
const config = { "default": true,
config: { "relative-links": true
default: true,
"relative-links": true,
}, },
globs: ["**/*.md"], "globs": ["**/*.md"],
ignores: ["**/node_modules"], "ignores": ["**/node_modules"],
customRules: [relativeLinksRule], "customRules": ["markdownlint-rule-relative-links"]
} }
export default config
``` ```
`package.json` `package.json`

2594
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -44,19 +44,19 @@
}, },
"devDependencies": { "devDependencies": {
"@types/markdown-it": "14.1.2", "@types/markdown-it": "14.1.2",
"@types/node": "22.15.17", "@types/node": "22.10.2",
"editorconfig-checker": "6.0.1", "editorconfig-checker": "6.0.0",
"eslint": "9.26.0", "eslint": "9.17.0",
"eslint-config-conventions": "19.2.0", "eslint-config-conventions": "18.0.0",
"eslint-plugin-promise": "7.2.1", "eslint-plugin-promise": "7.2.1",
"eslint-plugin-unicorn": "59.0.1", "eslint-plugin-unicorn": "56.0.1",
"eslint-plugin-import-x": "4.11.1", "eslint-plugin-import-x": "4.6.1",
"globals": "16.1.0", "globals": "15.14.0",
"markdownlint": "0.38.0", "markdownlint": "0.37.2",
"markdownlint-cli2": "0.18.0", "markdownlint-cli2": "0.17.0",
"prettier": "3.5.3", "prettier": "3.4.2",
"semantic-release": "24.2.3", "semantic-release": "24.2.0",
"typescript-eslint": "8.32.0", "typescript-eslint": "8.18.2",
"typescript": "5.8.3" "typescript": "5.7.2"
} }
} }

5
src/index.d.ts vendored
View File

@ -1,8 +1,5 @@
import type MarkdownIt from "markdown-it"
import type { Rule } from "markdownlint" import type { Rule } from "markdownlint"
declare const relativeLinksRule: Rule declare const relativeLinksRule: Rule
export default relativeLinksRule
declare const markdownIt: MarkdownIt export default relativeLinksRule
export { markdownIt }

View File

@ -12,8 +12,6 @@ import {
lineFragmentRe, lineFragmentRe,
} from "./utils.js" } from "./utils.js"
export { markdownIt } from "./utils.js"
/** @typedef {import('markdownlint').Rule} MarkdownLintRule */ /** @typedef {import('markdownlint').Rule} MarkdownLintRule */
/** /**

View File

@ -2,7 +2,7 @@ import MarkdownIt from "markdown-it"
import { getHtmlAttributeRe } from "./markdownlint-rule-helpers/helpers.js" import { getHtmlAttributeRe } from "./markdownlint-rule-helpers/helpers.js"
export const markdownIt = new MarkdownIt({ html: true }) const markdownIt = new MarkdownIt({ html: true })
export const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/ export const lineFragmentRe = /^#(?:L\d+(?:C\d+)?-L\d+(?:C\d+)?|L\d+)$/

View File

@ -3,7 +3,7 @@ import assert from "node:assert/strict"
import * as markdownlint from "markdownlint/promise" import * as markdownlint from "markdownlint/promise"
import relativeLinksRule, { markdownIt } from "../src/index.js" import relativeLinksRule from "../src/index.js"
/** /**
* *
@ -18,9 +18,6 @@ const validateMarkdownLint = async (fixtureFile) => {
"relative-links": true, "relative-links": true,
}, },
customRules: [relativeLinksRule], customRules: [relativeLinksRule],
markdownItFactory: () => {
return markdownIt
},
}) })
return lintResults[fixtureFile] return lintResults[fixtureFile]
} }