jscheid / prettier.el

Prettier code formatting for Emacs.
GNU General Public License v3.0
168 stars 12 forks source link

Fix loading of prettier.el when the file isn't open in a buffer #19

Closed aspiers closed 4 years ago

aspiers commented 4 years ago

Fixes #18.

I hope this is right but to be honest I'm not entirely sure why this is wrapped in eval-when-compile, so I'd appreciate a sanity check!

jscheid commented 4 years ago

Thanks, I don't recall either exactly why it uses eval-when-compile. I suspect the idea was that prettier.el is always the current file at compile time, which seems to be a bad assumption.

This is only for use in prettier-info; looking at it now, perhaps it should be a function rather than a constant as it will be needed only rarely.

Please feel free to refactor this more fundamentally. Also, just a heads up that linting seems to fail for some reason if you hadn't seen.

aspiers commented 4 years ago

OK, how's this now?

jscheid commented 4 years ago

Thank you!