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

Feature request: config option to disable linting unless a markdownlint file exists #266

Open jcmrva opened 1 year ago

jcmrva commented 1 year ago

After installing the extension, I noticed it lints every markdown file even when there's no .markdownlint present.

In repos I don't maintain, this results in a ton of lint highlights I don't feel like I should fix.

I'd prefer to avoid having to enable/disable the extension per-workspace or toggleLinting every time.

DavidAnson commented 1 year ago

As you point out, disabling the extension per workspace is natively supported by VS Code and a reasonable approach: https://code.visualstudio.com/docs/editor/extension-marketplace#_disable-an-extension

My concern with trying to auto-detect repositories is that there are many configuration file names that could be used to configure markdownlint-cli2 and there are no requirements for one of them to exist in the root of a project.

An alternate idea would be to let the user control the default value of toggleLinting. In your case, maybe defaulting it off would be better? Of course, then you're in the opposite situation where you need to remember to enable it for workspaces you care about.

There are other ways a workspace could opt in or out of linting, but you want the default (untouched) behavior for a repository to be off and I don't want everybody to have to opt their repositories in to keep linting working. I could add an option to look for a workspace configuration to specify the default for toggleLinting (i.e., two new settings), but I'm worried that's a lot of complexity for something that's only come up once so far.