DavidAnson / vscode-markdownlint

Markdown linting and style checking for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
MIT License
930 stars 170 forks source link

Allow the extends configuration to use remote files #334

Closed lvlcn-t closed 3 weeks ago

lvlcn-t commented 5 months ago

Issue

Currently, the markdownlint.config.extends configuration only supports local configuration files. This means that if you want to use the same configuration across multiple repositories, you need to copy the configuration file to each repository or rather have it included in the repo templates. This is not ideal as this adds yet another file to the repository and makes it harder to maintain a consistent configuration across multiple repositories.

Proposed Solution

Allow the use of a remote configuration file, like a github repository. This would allow for a centralized configuration file that can be used across multiple repositories.

Example VSCode Configuration

{
  "markdownlint.config": {
    "extends": "https://raw.githubusercontent.com/DavidAnson/vscode-markdownlint/main/.markdownlint.json"
  }
}
DavidAnson commented 5 months ago

If you want to share a common configuration file, I recommend using ${userHome} or ${workspaceFolder} per the documentation or referencing something like a common npm package from each project and using the same project-relative path from each of them. I do not plan to support dynamic downloads as proposed here, in part because the performance will be unpredictable and error-prone.

lvlcn-t commented 5 months ago

Thanks for the quick answer, I will look into your suggestions and see if that'll work for me. I understand the performance concerns with dynamic downloads but I think it wouldn't effect the performance too much if it's only done once when the configuration is loaded. I think this is also what the json and yaml parsers do for the schema files and imo it would be a nice feature to have but I understand if you don't want to implement it.