Code Monkey home page Code Monkey logo

Comments (6)

eqyiel avatar eqyiel commented on May 17, 2024

AFAICT the mode is called prettier-js-mode, not prettier-mode. Your config should be fine if you replace that.

from prettier-emacs.

rcoedo avatar rcoedo commented on May 17, 2024

also, the prettier command was refactored to prettier-js-prettify, following the elisp prefixing style.

from prettier-emacs.

dagda1 avatar dagda1 commented on May 17, 2024

How can I configure prettier to run after a save in js2-mode?

from prettier-emacs.

rcoedo avatar rcoedo commented on May 17, 2024

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.

dagda1 avatar dagda1 commented on May 17, 2024

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.

rcoedo avatar rcoedo commented on May 17, 2024

I'm glad you got it working! 🍻

from prettier-emacs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.