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

Adds hints to only allow *.md files #326

Closed flobee closed 5 months ago

DavidAnson commented 7 months ago

The default behavior is to lint only files that VS Code identifies as being Markdown files. Given that, what is the need for the configuration described here?

flobee commented 7 months ago

Hi

The default behavior is to lint only files that VS Code identifies as being Markdown files. Given that, what is the need for the configuration described here?

Well, im new to VSCod(ium|e) and i'm on *nix systems. And all files which have no file extension (on *nix systems there are a lot) are handled/identified as markdown compatible and the linter starts showing hints. Mostly config files. its annoing. ;-/ just the first line of my addition solves it and the second to be save that dot filename or dot dirname/* are ignored.

same like (i just use currently two extensions) with shellcheck (code checker for shell scripts) has similar proplems but finding a solution was much faster :-)

i think those kind of hints are very helpful for none windows user.

Kind regards, flobee

DavidAnson commented 7 months ago

I've used VS Code on Linux, Mac, and Windows, and the behavior you describe of treating extension-less files like Markdown is not the default. I suspect that something else in your environment is causing that behavior. You can experiment in github.dev by pressing the "." key on this repo or any other from GitHub.com. That will load the web experience and you can open different files and check the bottom right corner of the window to see what type is being assigned to them. You can also install the markdownlint extension to see if that influences things. If you see the same behavior with this approach, please reply to me with the exact steps to reproduce. Otherwise, I do not wish to call out a workaround for something most people will never encounter.

DavidAnson commented 7 months ago

I played around in github.dev a bit for this repo just now to see if anything had changed recently. .npmrc is treated as a properties file, .gitignore and .vscodeignore are treated as ignore files, and LICENSE is recognized as a license (note the key icon) and treated as Markdown. A new file called random was treated as plain text. All of this seems reasonable to me and happens even without the markdownlint extension installed. You may disagree with LICENSE as Markdown and there's probably a way you can tell VS Code to treat it differently. But I think that's where you want to make the change because VS Code will behave differently for files it thinks are Markdown. Changing the behavior only for this extension does not seem like the best approach to me as it does not address the broader issue.

DavidAnson commented 7 months ago

This page seems to document how to change language associations in VS Code: https://code.visualstudio.com/docs/languages/overview

flobee commented 7 months ago

Thx for your hints, i come back later with it. (wondering, i have a clean install of vs codium) I dont want you to change anything except giving some hints a the readme.

DavidAnson commented 5 months ago

Added a pointer to the VS Code documentation for language modes to the README: https://github.com/DavidAnson/vscode-markdownlint/commit/3fe08152281113f156ddc2e573348053f0930ba8.

flobee commented 1 month ago

Currently my problem dont come up anymore. maybe because of my settings or because of fixes of the editor. But having an idea for other people: the docs could tell ;-)