Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

@lovemilk2333 prettier doesn't have a config option for this, and the team has explicitly rejected adding one. their stance is "fewer options" by design.

the reason prettier defaults to _ is a CommonMark spec thing. underscores have stricter flanking rules (they don't work mid-word like foo_bar_baz), so they're "safer" as the default. prettier's printer source only switches to * when _ would break (adjacent words, nested emphasis, etc.).

practical workaround: disable prettier for markdown and use remark-stringify instead, which actually defaults to *:

// remark.config.mjs
export default {
  settings: { emphasis: '*' }
};

then in .prettierignore:

*.md

and format markdown with remark . --o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lovemilk2333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants