Comments (6)
AFAICT the mode is called prettier-js-mode
, not prettier-mode
. Your config should be fine if you replace that.
from prettier-emacs.
also, the prettier
command was refactored to prettier-js-prettify, following the elisp prefixing style.
from prettier-emacs.
How can I configure prettier to run after a save in js2-mode?
from prettier-emacs.
prettier-js-mode
runs prettier-js-prettify
on save if the mode is activated. You just need to add a hook to js2. There is an example in the README.md
(add-hook 'js2-mode-hook 'prettier-js-mode)
If you want to load prettier-js with use-package, I believe you can do something like this
(use-package prettier-js
:init
(add-hook 'js2-mode-hook 'prettier-js-mode))
I hope this helps 😄
from prettier-emacs.
brilliant, works a treat.
You have no idea the config options I have been through to try and j2-mode or web-mode work with pure render functions without the parenthesis e.g.
const myComp = props =>
<div>foo</foo>
Now I finally have something that works.
Great work!
from prettier-emacs.
I'm glad you got it working! 🍻
from prettier-emacs.
Related Issues (20)
- How validate and format json HOT 1
- "No such file or directory" "prettier" Error HOT 1
- Using eslint_d to do the same as this package
- [question] "prettier-js is an available obsolete package."
- Disable formatting on save HOT 3
- prettier empties file HOT 1
- Could not apply prettier HOT 1
- diff error on OpenBSD
- prettier-js-mode reformats file even when file is in .prettierignore HOT 3
- "prettier errors: env: node: No such file or directory" HOT 6
- Highlighting "flickering" while applying formatting HOT 2
- Searching for program: No such file or directory, prettier HOT 2
- [warn] Ignored unknown option --stdin HOT 1
- Convenient way to disable per file HOT 1
- No files matching the pattern were found: "false". HOT 2
- Cannot find prettier anywhere HOT 2
- Prettier not formatting typescript file HOT 1
- do not respect .prettierignore
- Not working with prettier 3.0.1 HOT 2
- Handle cloned buffers and give error message when not visiting a file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier-emacs.