-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support configuration file in parent directory of CWD #53
Comments
Scanning is rooted from the current directory when the tool is run. The behavior you describe is therefore expected. The alternative is to scan every parent directory all the way up to the root of the file system which would be a performance hit and feels to me like a security/expectation violation. That said, I am aware some other tools do so. |
Note all the time and energy ESLint spends describing this behavior and all the implications/unexpected side effects: https://eslint.org/docs/latest/user-guide/configuring/configuration-files#cascading-and-hierarchy |
Understood, thanks. I wasn't sure if this was a bug or intended behavior. I can see merits for both approaches, and I wouldn't suggest changing the approach used here. |
I understand this tool supports merging/overriding a hierarchy of configuration files in parent directories of the target file to lint. However, it does not appear to consider configuration files in anything above the current working directory.
Consider this directory structure:
If I run
markdownlint-cli2
from the root of this directory tree, then both.markdownlint.yaml
andfoo/.markdownlint.yaml
will be used to lintfoo/bar/baz.md
.However, if I change my directory to
foo
, then run it again, onlyfoo/.markdownlint.yaml
is used. If I then change tofoo/bar
, then neither will be used.This is counterintuitive considering the behavior of nested/parent configs below the current directory. One would expect that relationship to work the other way, too.
The text was updated successfully, but these errors were encountered: