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.

Extension 'Prettier - Code Formatter' cannot format html when using custom plugin

See original GitHub issue

I’ve developed a plugin for Prettier available on NPM as prettier-plugin-tailwind-classes-sorter.

When trying to use this in VSCode, I receive an error:

Extension ‘Prettier - Code Formatter’ cannot format index.html

Screenshot

But the plugin works when using Prettier cli with ./node_modules/.bin/prettier ./index.html


To reproduce, in an empty project:

yarn add --dev prettier prettier-plugin-tailwind-classes-sorter
echo "module.exports={theme:{},variants:{},plugins:[]}" > ./tailwind.config.js
echo "<html><body class="w-full container"></body></html>" > ./index.html

Then restart VSCode.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tqwewecommented, Jan 27, 2020

Sorry, I forgot to include that… I’ve updated the original issue comment.

0reactions
github-actions[bot]commented, Apr 26, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prettier not formatting HTML files in VS Code - Stack Overflow
I simply solved it by right-clicking in the file, select 'Format Document with' and choose 'prettier ...
Read more >
Prettier extension not working on HTML files : r/vscode - Reddit
First make sure that you don't have multiple extensions to format html files. · If that didn't help you should inspect your settings....
Read more >
Prettier - Code formatter - Visual Studio Marketplace
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that ......
Read more >
How to fix Prettier Extension not working issue in VS CODE
Your browser can't play this video. Learn more. Switch camera.
Read more >
VS Code - You don't need a formatting ... - DEV Community ‍ ‍
The built-in CSS extension now ships with a formatter. ... I don't use React, so I can't comment how well React code is...
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