Skip to content

Commit

Permalink
Always supply --stdin-filepath to Prettier
Browse files Browse the repository at this point in the history
This is required for Prettier to pick up the correct settings from its
config files.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Nov 22, 2023
1 parent 615b0f5 commit 6b3fc77
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions apheleia-formatters.el
Original file line number Diff line number Diff line change
Expand Up @@ -86,40 +86,48 @@
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-css
. ("apheleia-npx" "prettier" "--parser=css"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=css"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-html
. ("apheleia-npx" "prettier" "--parser=html"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=html"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-graphql
. ("apheleia-npx" "prettier" "--parser=graphql"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=graphql"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-javascript
. ("apheleia-npx" "prettier" "--parser=babel-flow"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=babel-flow"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-json
. ("apheleia-npx" "prettier" "--parser=json"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=json"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-markdown
. ("apheleia-npx" "prettier" "--parser=markdown"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=markdown"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-ruby
. ("apheleia-npx" "prettier" "--stdin-filepath" "dummy.rb"
"--plugin=@prettier/plugin-ruby"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--plugin=@prettier/plugin-ruby" "--parser=ruby"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-scss
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=scss"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-svelte
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--plugin=prettier-plugin-svelte"
"--plugin=prettier-plugin-svelte" "--parser=svelte"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-typescript
. ("apheleia-npx" "prettier" "--parser=typescript"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=typescript"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(prettier-yaml
. ("apheleia-npx" "prettier" "--parser=yaml"
. ("apheleia-npx" "prettier" "--stdin-filepath" filepath
"--parser=yaml"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(purs-tidy . ("apheleia-npx" "purs-tidy" "format"))
(rubocop . ("rubocop" "--stdin" filepath "--auto-correct"
Expand Down

0 comments on commit 6b3fc77

Please sign in to comment.