diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc index ecffe91..42d456b 100644 --- a/.markdownlint-cli2.jsonc +++ b/.markdownlint-cli2.jsonc @@ -1,16 +1,6 @@ { "config": { - "code-block-style": { "style": "fenced" }, - "line-length": false, - "no-duplicate-heading": { "siblings_only": true }, - "ol-prefix": { "style": "ordered" }, - - // The dprint hook runs before this linter, so these match its output. - "code-fence-style": { "style": "backtick" }, - "emphasis-style": { "style": "underscore" }, - "heading-style": { "style": "atx" }, - "strong-style": { "style": "asterisk" }, - "ul-style": { "style": "dash" }, + "extends": "./.markdownlint.jsonc", }, "gitignore": true, diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc new file mode 100644 index 0000000..31a1bba --- /dev/null +++ b/.markdownlint.jsonc @@ -0,0 +1,13 @@ +{ + "code-block-style": { "style": "fenced" }, + "line-length": false, + "no-duplicate-heading": { "siblings_only": true }, + "ol-prefix": { "style": "ordered" }, + + // The dprint hook runs before this linter, so these match its output. + "code-fence-style": { "style": "backtick" }, + "emphasis-style": { "style": "underscore" }, + "heading-style": { "style": "atx" }, + "strong-style": { "style": "asterisk" }, + "ul-style": { "style": "dash" }, +} diff --git a/docs/hooks.md b/docs/hooks.md index 3d7804d..d9051f5 100644 --- a/docs/hooks.md +++ b/docs/hooks.md @@ -56,11 +56,11 @@ preCommit = dk.preCommit { ### Use a project configuration file -Prettier, Taplo, and markdownlint-cli2 use devkit's shared [Prettier style](../.prettierrc.json), [Taplo formatting](../.taplo.toml), and [markdownlint rules](../.markdownlint-cli2.jsonc). A `.prettierrc.json` or `.taplo.toml` at the source root replaces the shared file once the dev shell is re-entered, and a project `.markdownlint-cli2.jsonc` overrides individual shared rules. +- A root **Prettier** config (`.prettierrc.json`) replaces the [shared config](../.prettierrc.json). The hook disables EditorConfig. Use basename globs in shared overrides because Prettier resolves them from the Nix store. +- A root **Taplo** config (`.taplo.toml`) replaces the shared config. Copy the [shared file](../.taplo.toml) to the project root for native discovery. +- A project **markdownlint-cli2** config (`.markdownlint-cli2.jsonc`) overrides rules from the [shared CLI2 config](../.markdownlint-cli2.jsonc). Relative `customRules` and `markdownItPlugins` require `configPath = ".markdownlint-cli2.jsonc"`. For an explicit project config or native discovery, use `config.extends` with a workspace-relative copy of the [shared rules](../.markdownlint.jsonc). -Use basenames in the shared Prettier configuration's `overrides`, since Prettier resolves those globs from the configuration's Nix store directory. - -Set `hooks..settings.configPath` to point markdownlint-cli2, Prettier, Ruff, or Taplo at another file, or to `""` to let the tool find its own. A `.markdownlint-cli2.jsonc` that loads relative `customRules` or `markdownItPlugins` needs `configPath = ".markdownlint-cli2.jsonc"`, which drops the shared rules. +Re-enter the dev shell after adding a root Prettier or Taplo config. For these hooks and Ruff, set `hooks..settings.configPath = ""` to use native discovery, or set it to a specific file. ### Add a spelling dictionary @@ -72,13 +72,11 @@ doctoc fills a table of contents between `` and `