remark-lint-frontmatter-schema
remark-lint-frontmatter-schema copied to clipboard
ResolverError and .remarkrc file not working on VSCode Windows
I believe I have encountered a path resolving issue with remark-lint-frontmatter-schema on VSCode Windows (v1.84.2).
I am using a VSCode test profile with only vscode-remark extension (v2.1.0) installed.
Here's how the bug is produced:
- Clone the demo repo.
- Follow the installation step
pnpm install remark ...
- Follow the installation step
code --install-extension ...
- Follow the instruction and create the root config
./.remarkrc.mjs
- Explore and tinker with the
content
folder md files to observe the bug behaviour:
behind-the-gare-st-lazare__local-broken.md
file gives an error
YAML schema file load/parse: content\creative-work.schema.yaml — ResolverError: Error opening file "D:\test remark\node_modules\.pnpm\@[email protected]\node_modules\@apidevtools\json-schema-ref-parser\dist\content\creative-work.schema.yaml" ENOENT: no such file or directory, open 'D:\test remark\node_modules\.pnpm\@[email protected]\node_modules\@apidevtools\json-schema-ref-parser\dist\content\creative-work.schema.yaml'
however, if the '$schema'
parameter is set to ./content/creative-work.schema.yaml
, the linting works
The the-shipwreck__global-broken.md
file does not report any linting error when opened. When '$schema': ./content/creative-work.schema.yaml
is pasted, the linting problems show up.
There is no mentioning of whether the .remarkrc.mjs
file was loaded correctly - there was no error message, but when I supply a wrong schema path or target path, it still does not produce any error message.
This is my pnpm-lock file, hope it helps figuring out what went wrong.
Great report, thank you for all those details.
Unfortunately, I don't use non POSIX-compliant OSes anymore, even though I tried to use Win-friendly path resolving mechanisms inside this package, like minimatch
, find-up
…
E.g. we had previous issues with the infamous \
problem (#12). This package used to use rawer mechanisms ;)
I'll try to reproduce this ASAP and I'll get back to you when I got any more insights.
I just ran into the same problem while using a docker alpine environment with the extension ms-vscode-remote.remote-containers.
PR is welcome from Windows users, on this bug 🫶🏻. For me, fixing bugs can be insightful and rewarding, but using this OS… is not 🫠.
Absolutely understandable, though I will write a custom extension for my use case as I need general good frontmatter support with autocomplete and documentation. You can take these ideas as inspiration, it would be pretty cool if your plugin supported more editor features (if that's possible/sensical in this repo).