Summary
trunk init generates .trunk/configs/.markdownlint.yaml with:
extends: markdownlint/style/prettier
This works in trunk check because Trunk's markdownlint wrapper sets NODE_PATH to Trunk-managed node_modules, but it fails when the same config is used by VSCode extension DavidAnson.vscode-markdownlint via "markdownlint.configFile".
This makes the generated config non-portable and confusing, especially compared to the older Trunk-generated config that disabled formatting rules directly (no extends).
Repro steps
-
In a repo containing any Markdown files, run:
trunk init
- When prompted to install markdownlint (with others), answer
Y.
-
Confirm generated file .trunk/configs/.markdownlint.yaml contains:
extends: markdownlint/style/prettier
-
In VSCode, add to .vscode/settings.json:
{
"markdownlint.configFile": ".trunk/configs/.markdownlint.yaml"
}
-
Open any .md file.
Actual result (VSCode output)
VSCode shows repeated errors like:
Error: Unable to use configuration file '~/Development/01_personal/apr-app-assignment/.trunk/configs/.markdownlint.yaml'; Error: ENOENT: no such file or directory, open '~/Development/01_personal/apr-app-assignment/.trunk/configs/markdownlint/style/prettier'
stack:
at xc (~/.vscode/extensions/davidanson.vscode-markdownlint-0.61.1/bundle.js:39:39268)
at ~/.vscode/extensions/davidanson.vscode-markdownlint-0.61.1/bundle.js:39:47281
at async Ic (~/.vscode/extensions/davidanson.vscode-markdownlint-0.61.1/bundle.js:39:46482)
cause:
EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open '~/Development/01_personal/apr-app-assignment/.trunk/configs/markdownlint/style/prettier'
stack:
at Lr.e (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:18080)
at Object.readFile (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:116:16601)
Expected result
The Trunk-generated markdownlint config should be usable by standard markdownlint tooling, including VSCode extension, without requiring repo-specific path rewrites.
Why it happens
vscode-markdownlint / markdownlint-cli2 resolves extends as a path relative to the config file location. So extends: markdownlint/style/prettier is interpreted as:
.trunk/configs/markdownlint/style/prettier
which does not exist.
Meanwhile, Trunk’s wrapper sets:
NODE_PATH=~/.cache/trunk/tools/markdownlint/.../node_modules
so Trunk CLI runs succeed, masking the portability issue.
Wrapper snippet for reference (.trunk/tools/markdownlint):
export NODE_PATH=".../node_modules"
exec markdownlint "$@"
Regression / historical behavior
Older trunk init versions used a self-contained config like:
default: true
blank_lines: false
bullet: false
html: false
indentation: false
line_length: false
spaces: false
url: false
whitespace: false
This worked everywhere without relying on extends resolution.
Suggested fixes
One of:
- Revert to generating a self-contained config (disable formatting rules directly).
- Vendor/emit the preset file under
.trunk/configs/... and use a relative extends: ./markdownlint/style/prettier.
- Document prominently that the generated config is Trunk-runtime-specific and provide a VSCode-compatible variant.
Environment
- OS: macOS (Apple Silicon)
- VSCode: Version: 1.109.4
- Extension: DavidAnson.vscode-markdownlint 0.61.1
- Trunk: 1.25.0
- Tool versions (from Trunk cache): markdownlint 0.47.0, node 22.16.0
Summary
trunk initgenerates.trunk/configs/.markdownlint.yamlwith:This works in
trunk checkbecause Trunk's markdownlint wrapper setsNODE_PATHto Trunk-managed node_modules, but it fails when the same config is used by VSCode extensionDavidAnson.vscode-markdownlintvia"markdownlint.configFile".This makes the generated config non-portable and confusing, especially compared to the older Trunk-generated config that disabled formatting rules directly (no
extends).Repro steps
In a repo containing any Markdown files, run:
trunk initY.Confirm generated file
.trunk/configs/.markdownlint.yamlcontains:In VSCode, add to
.vscode/settings.json:{ "markdownlint.configFile": ".trunk/configs/.markdownlint.yaml" }Open any
.mdfile.Actual result (VSCode output)
VSCode shows repeated errors like:
Expected result
The Trunk-generated markdownlint config should be usable by standard markdownlint tooling, including VSCode extension, without requiring repo-specific path rewrites.
Why it happens
vscode-markdownlint/markdownlint-cli2resolvesextendsas a path relative to the config file location. Soextends: markdownlint/style/prettieris interpreted as:.trunk/configs/markdownlint/style/prettierwhich does not exist.
Meanwhile, Trunk’s wrapper sets:
NODE_PATH=~/.cache/trunk/tools/markdownlint/.../node_modulesso Trunk CLI runs succeed, masking the portability issue.
Wrapper snippet for reference (
.trunk/tools/markdownlint):Regression / historical behavior
Older
trunk initversions used a self-contained config like:This worked everywhere without relying on
extendsresolution.Suggested fixes
One of:
.trunk/configs/...and use a relativeextends: ./markdownlint/style/prettier.Environment