You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I understand currently markdownlint looks for .markdownlint.jsonc up until Visual Studio Code workspace folder or until current directory (if run via CLI). In my opinion it should not stop there, but instead look for the file in every parent directory, and stop on first found or when there is no more parent folder.
This is how in my opinion all linters/formatters work, e.g. ESLint, Prettier, EditorConfig. Some, like EditorConfig or .gitignore\.gitattributes read all the config files along the way and merge all settings , and some, like Prettier and ESLint just stop on first found (from what I understand ESLint originally used so called "cascaded" approach, but now they do not). IMO the latter is the right approach for markdownlint. Prettier implements it via lilconfig.
Here is an example where it is useful behaviour (and exactly the one where I would use it):
Assume a repository with multiple projects in subfolders, like:
\repo\
project1\
.gitignore
.markdownlint.jsonc <-- I do not want to repeat that file in every project!
...
project2\
.gitignore
.markdownlint.jsonc <-- I do not want to repeat that file in every project!
....
.gitignore
.prettierrc
I can put multiple config files in the repository root, so that all projects inherit them, e.g. I can just open vscode in the project1 folder, but still settings from repo will apply. This works e.g. for .gitignore (but here I want additional per-project .gitignore files) or .prettierrc (just single one in my case, but if I want to I could add .prettierrc in project folder and then explicitely import settings from parent). Sadly currently I have to copy .markdownlint.jsonc in every project folder, or otherwise the settings are not picked up!
The text was updated successfully, but these errors were encountered:
(I transferred this issue from the markdownlint project because that library does not implement the behavior you describe.)
This is a duplicate of #53. You can read about why I have not implemented this behavior and follow the link to ESLint documentation for all the complexity/uncertainty this behavior causes for them.
I think that what you want to do is already supported by the --config parameter which can be used to point to your non-project shared options file.
Thanks for moving it to proper place and the reply and not closing it on-the-spot:)
I believe that originally ESLint used so called "cascaded" approach, in which settings from all parent folder are merged in. In the current approach, they just search for the first config, up to the root folder, which is exactly what I propose for markdownlint.
My reply above is similarly relevant for both approaches you describe. If you are using a single configuration file, the "config" parameter is even easier to use. I will close this issue now as a confirmed duplicate.
From what I understand currently markdownlint looks for
.markdownlint.jsonc
up until Visual Studio Code workspace folder or until current directory (if run via CLI). In my opinion it should not stop there, but instead look for the file in every parent directory, and stop on first found or when there is no more parent folder.This is how in my opinion all linters/formatters work, e.g. ESLint, Prettier, EditorConfig. Some, like EditorConfig or
.gitignore\.gitattributes
read all the config files along the way and merge all settings , and some, like Prettier and ESLint just stop on first found (from what I understand ESLint originally used so called "cascaded" approach, but now they do not). IMO the latter is the right approach for markdownlint. Prettier implements it via lilconfig.Here is an example where it is useful behaviour (and exactly the one where I would use it):
Assume a repository with multiple projects in subfolders, like:
I can put multiple config files in the repository root, so that all projects inherit them, e.g. I can just open vscode in the
project1
folder, but still settings fromrepo
will apply. This works e.g. for.gitignore
(but here I want additional per-project.gitignore
files) or.prettierrc
(just single one in my case, but if I want to I could add.prettierrc
in project folder and then explicitely import settings from parent). Sadly currently I have to copy.markdownlint.jsonc
in every project folder, or otherwise the settings are not picked up!The text was updated successfully, but these errors were encountered: