How to run prettier against changed files using jj fix #4291
-
I'm working in a TypeScript/React codebase that consists of json, html, TypeScript and CSS files. Prettier is a great formatter that can handle all of these filetypes. However, when using stdin/stdout it needs to be explicitly told what parser to use for formatting (ie. html, typescript, etc). I tried setting up a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Here's my Prettier setup: fix.tools.prettier.command = ["npx", "prettier", "--stdin-filepath=$path"]
fix.tools.prettier.patterns = ["glob:'**/*.tsx'", "glob:'**/*.ts'", "glob:'**/*.jsx'", "glob:'**/*.js'", "glob:'**/*.css'", "glob:'**/*.html'"] You can use |
Beta Was this translation helpful? Give feedback.
-
@bnjmnt4n Tried that but running
Do you have anything set for that? |
Beta Was this translation helpful? Give feedback.
Here's my Prettier setup:
You can use
$path
, and Prettier should be able to infer the filetype from the pathname.