Closed skwde closed 6 months ago
This MAY already work today for ESM modules - but if so, it will NOT work within VS Code because Electron does not load ESM modules (yet). You could try this via CLI2 directly - my thinking is that the existing fallback of require
to import
may/should "just work" for this.
I have no idea what you are talking about.
Obviously it doesn't work, but it would be nice if it does. It would no longer require to have a node install just for an additional lint rule.
If you're talking about markdownlint-cli2
automatically running npm
or yarn
to install custom rule packages, that's outside the scope of what I think this tool should do. If you're suggesting markdownlint-cli2
should try to download all the the implicit/explicit scripts and (sub-)dependencies of an arbitrary JavaScript file as shown above, that's even further out of scope in my mind.
The way something like this could work is via ESM modules... however trying that myself produces the following error from Node 20, so I don't think this is practical yet:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'http:'
This is kind of a follow up to https://github.com/DavidAnson/vscode-markdownlint/issues/180.
I think it would be good if the option
not only supports local files, but also remote files, i.e. something like
gives the error
Related: