Support prettier-ignore-start/end for other languages (not only Markdown)
See original GitHub issueIt seems this feature was added only for markdown (#4202 cc @ikatyang), but it’s actually useful for other languages as well. It is not working on typescript files on my tests.
Related: https://github.com/facebook/create-react-app/issues/5543
Environments:
- Prettier Version: 1.14.3
- Running Prettier via: CLI
- Runtime: Node.js v8.11.4
- Operating System: macOS
Steps to reproduce:
Create a index.d.ts
file with the following content:
// prettier-ignore
type A1 = string;
// prettier-ignore
type A2 = string
/* prettier-ignore-start */
type B1 = string;
type B2 = string
/* prettier-ignore-end */
type C1 = string;
type C2 = string
Expected behavior:
// prettier-ignore
type A1 = string;
// prettier-ignore
type A2 = string
/* prettier-ignore-start */
type B1 = string;
type B2 = string
/* prettier-ignore-end */
-type C1 = string;
+type C1 = string
type C2 = string
Actual behavior:
// prettier-ignore
type A1 = string;
// prettier-ignore
type A2 = string
/* prettier-ignore-start */
-type B1 = string;
+type B1 = string
type B2 = string
/* prettier-ignore-end */
-type C1 = string;
+type C1 = string
type C2 = string
Issue Analytics
- State:
- Created 5 years ago
- Reactions:306
- Comments:53 (12 by maintainers)
Top Results From Across the Web
Prettier disable on certain languages not working
Try adding *.ejs to the .prettierignore file. You can read more about it here: https://prettier.io/docs/en/ignore.html.
Read more >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 block - You.com | The search engine you control.
prettier-ignore-start and prettier-ignore-end are supported only in Markdown. ... prettier-ignore-start/end for other languages (not only Markdown)#5287.
Read more >Disabling languages for Prettier (in VScode) | Zell Liew
How to disable Prettier for specific languages. ... You just added a prettier. ... Don't worry about where to start. I'll send you...
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
Okay, I will start working on this feature if there are at least 100 thumbs up on this comment. Let’s see if people still need this feature except myself.
@muuvmuuv There’s already
// prettier-ignore
– check it out! https://prettier.io/docs/en/ignore.html#javascript