-
Notifications
You must be signed in to change notification settings - Fork 38
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
markdownlint config doesn't seem to be respected #788
Comments
Hi! We discussed in Slack what was happening here. Duplicating here as well for visibility: Markdownlint is being respected correctly, but prettier is taking precedence/ignoring that config. The main point here is that linters and formatters need to be configured to synergize. In the case of markdownlint, we provide a default config that turns off all formatting: # Prettier friendly markdownlint config (all formatting rules disabled)
extends: markdownlint/style/prettier If you want to opt out of this, you'll need to make sure prettier and markdownlint configs are in sync, or disable prettier for markdown files: lint:
ignore:
- linters: [prettier]
paths: [**/*.md] One other option is to add an additional command lint:
definitions:
- name: markdownlint
commands:
- name: fix
output: rewrite
run: markdownlint ${target} --fix
success_codes: [0, 1]
batch: true
formatter: true
in_place: true
cache_results: true |
where's the logic for what prettier covers. I've used markdownlint as the formatter for years and I thought it covered far more. Would like to examine. This lint with one tool + format with another can result in formatting "whiplash" so I want to examine what it does better. |
Makes sense! We have a bit of recommendations about formatter/linter pairings here, but the actual source for these integrations is here:
We generally recommend prettier as the default formatter for most file types because it covers so many and works generally OOTB, with lots of options for fine tuning individual styling. Let me know if there's anything else I can point you to |
Trunk doesn't seem to honor the markdownlint config changes I've made.
link to example of mapping.
I've tried a lot of variations but I can't get trunk to honor .markdownlint.yaml
I run the markdownlint vscode plugin and it honors the file, but in repo when I tweak it seems to ignore the file.
For example changing indentation level to 12, it works with markdownlint tool itself, but then using trunk as my formatter it seems to go back to standard config and not honor it.
I've tried both .markdownlint.yaml and .markdownlint.jsonc and neither seems to be picked up.
I've also tried placing in root of repo and copying to .trunk/configs and no change in behavior.
Trunk config
.markdownlint.yaml
The text was updated successfully, but these errors were encountered: