prettier / prettier/plugin-pug
mixin arguments can not be formatted
Open
Nobody has claimed this yet.
type: enhancement
- Dominant language
- TypeScript
- Stars
- 208
- Forks
- 49
- Avg merge
- 4h 26m
- Merged PRs (30d)
- 8
Description
If I have the following formatted code:
+link({
name: 'Solutions',
subnav: {
sublinks: [
{name: 'WISP', url: '#', icon:'wisp'},
{name: 'Fiber', url: '#', icon:'fiber'},
{name: 'MDU', url: '#', icon:'mdu'},
{name: 'Voice', url: '#', icon:'voice'},
{name: 'Cable', url: '#', icon:'cable'},
{name: 'Enterprise', url: '#', icon:'enterprise'}
]
}
})
It gets formatted to the following:
+link({ name: 'Solutions', subnav: { sublinks: [ {name: 'WISP', url: '#', icon:'wisp'}, {name: 'Fiber', url: '#', icon:'fiber'}, {name: 'MDU', url: '#', icon:'mdu'}, {name: 'Voice', url: '#', icon:'voice'}, {name: 'Cable', url: '#', icon:'cable'}, {name: 'Enterprise', url: '#', icon:'enterprise'} ] }})
Is there any possible way to prevent this reformatting from happening, as it makes parsing the information far more difficult?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Pug mixin input and its formatted output. Trace the formatter behavior for multiline mixin arguments; done means preserving a readable multiline structure instead of collapsing the argument object onto one line, with a regression test for this example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pug
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100