MD031 should ignore prettier-ignore comment
See original GitHub issuePutting <!-- prettier-ignore -->
one line above some code block will cause the error MD031 - Fenced code blocks should be surrounded by blank lines.
It should ignore html comments when checking for blank lines.
The prettier-ignore is needed, because otherwise prettier would format the code to one line, removing my intended formatting.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Ignoring Code - Prettier
Use .prettierignore to ignore (i.e. not reformat) certain files and folders completely. Use “prettier-ignore” comments to ignore parts of files.
Read more >prettier ignore comment - You.com | The search engine you control.
Use “prettier-ignore” comments to ignore parts of files. Ignoring Files: .prettierignore. To exclude files from formatting, create a .prettierignore file in ...
Read more >How to make Prettier to ignore a block of code? - Stack Overflow
// prettier-ignore const a = 'a';. would be preserved after formatting. If you want to keep both assignments in one line without changing...
Read more >Markdownlint - Visual Studio Marketplace
Some constructs don't work well in all parsers and should be avoided. ... the example above will ignore issues on the line with...
Read more >Ignoring rules | Dev Cheatsheets - Michael Currin
eslint-disable-next-line prettier/prettier console.log('foo'). Global ignore config. A plain text file. .prettierignore e.g.. build/ *.html. Dev Cheatsheets.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI: I opened https://github.com/prettier/prettier/issues/5971 to track the unexpected reformatting in the
Prettier
project. I’ll use this issue to track the above suggestion formarkdownlint
.No idea, sorry. I am relatively new to the world of linters 😉 But I feel that a html comment could be placed anywhere and should just be ignored by the linter. Especially because the comment used as a ignore rule has to be directly attached to the code it belongs to.