Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Plugin removes all content of the Pug files! #168

Closed
aero31aero opened this issue Dec 4, 2020 · 2 comments
Closed

Bug: Plugin removes all content of the Pug files! #168

aero31aero opened this issue Dec 4, 2020 · 2 comments
Assignees
Labels
dependencies Pull requests that update a dependency file type: bug Functionality that does not work as intended/expected

Comments

@aero31aero
Copy link

Info

Tool Version
Plugin v1.13.0
Prettier v2.0.5
Framework none
Node v14.9.0
OS linux

Prettier config

module.exports = {
    trailingComma: 'es5',
    tabWidth: 4,
    semi: true,
    singleQuote: true,
};

Input

html
	head
		title Rohitt - Fun Stuff
	body
		h1 Fun Stuff
		ul
			li
				strong
					a(href="/fun/neon-dystopia") Neon Dystopia
				br
				span Atmos 2017 Homepage, Three JS.
			li
				strong
					a(href="/fun/rabbit") Frightened Rabbit [WIP]
				br
				span Visuals for a song I love, Three JS.

Output or Error

The diff is:

diff --git src/fun/index.pug src/fun/index.pug
index a27d450..e69de29 100644
--- src/fun/index.pug
+++ src/fun/index.pug
@@ -1,16 +0,0 @@
-html
-	head
-		title Rohitt - Fun Stuff
-	body
-		h1 Fun Stuff
-		ul
-			li
-				strong
-					a(href="/fun/neon-dystopia") Neon Dystopia
-				br
-				span Atmos 2017 Homepage, Three JS.
-			li
-				strong
-					a(href="/fun/rabbit") Frightened Rabbit [WIP]
-				br
-				span Visuals for a song I love, Three JS.

Expected Output

Anything else at all.

Additional Context

Just running prettier src/fun/index.pug --write removes all content from the pug file. Reproducible across the project (running on all files with a glob clears all pug files).

Severity

I think this is a very severe bug. I was running this on a git repo and all my files I'd edited this session were open in my editor but its quite likely someone might accidentally run this before their first commit or after significant work but before committing. Bailing out would be better than blanking the files.

@Shinigami92
Copy link
Member

Could you retry with prettier >= 2.1? If this is the problem I need to clarify this in peer dependencies.

@Shinigami92 Shinigami92 added the needs clarification The issue is missing information label Dec 4, 2020
@Shinigami92
Copy link
Member

Yes, that is it! Will bump peerDependencies to >= 2.1

@Shinigami92 Shinigami92 removed the needs clarification The issue is missing information label Dec 8, 2020
@Shinigami92 Shinigami92 self-assigned this Dec 8, 2020
@Shinigami92 Shinigami92 added dependencies Pull requests that update a dependency file type: bug Functionality that does not work as intended/expected labels Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file type: bug Functionality that does not work as intended/expected
Projects
None yet
Development

No branches or pull requests

2 participants