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

Add option to disable pretty print through comments #131

Open
rohit-gohri opened this issue May 29, 2019 · 0 comments
Open

Add option to disable pretty print through comments #131

rohit-gohri opened this issue May 29, 2019 · 0 comments

Comments

@rohit-gohri
Copy link

prettyprint

Description

I'm using marko in some weird ways like dynamically opening and closing ul tags in a for loop:

		<if (openCondition)>
			$!{'<ul>'}
		</if>
		<if (closeCondition)>
			$!{'</ul>'}
		</if>

This is pretty printed to:

		<if (openCondition)>
			<ul>
		</if>
		<if (closeCondition)>
			</ul>
		</if>

Which doesn't work because it throws an error:
The closing "ul" tag does not match the corresponding opening "if(openCondition)>

Why

This would help increase usage of pretty print as a standard linting option, as projects that are not being able to use it because of some edge cases can disable it in the code itself for that edge case.

Currently I would have to make a custom script around this module and maintain a list of files to be excluded.

Possible Implementation & Open Questions

I propose adding something akin to eslint's disable-line/disable-next-line/disable-file comments that will tell pretty print to not change the corresponding part of the template.

Is this something you're interested in working on?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant