Dot in path makes prettier not recognise Markdown files
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 52.3k
- Forks
- 5k
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 117
Description
This one had me pulling my hair out for a while. I'm trying to format a Markdown file in a subfolder, e.g.,
cat 1402.00708/article.md
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
prettier, however, doesn't do anything:
prettier 1402.00708/article.md --prose-wrap=always
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Long story short, the culprit is the dot . in the folder name; prettier apparently doesn't recognize the file as Markdown then.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with the shown prettier 1402.00708/article.md --prose-wrap=always command and compare it with a path without a dot. Then trace Prettier's file-type recognition for dotted paths; no source file or test is identified in the report, so locate the relevant entry point from the reproduction. Done means Markdown files in dotted directories are recognized and prose wrapping works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, markdown
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100