question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MD031 should ignore prettier-ignore comment

See original GitHub issue

Putting <!-- 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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DavidAnsoncommented, Mar 14, 2019

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 for markdownlint.

0reactions
plehnencommented, Mar 13, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found