prettier-react-tachyons icon indicating copy to clipboard operation
prettier-react-tachyons copied to clipboard

Doesn't work with prettier-atom

Open marcofugaro opened this issue 7 years ago • 4 comments

Hey, first congrats on this project, it's awesome!

I wanted to try it with prettier-atom since it runs prettier on the file save, but it's not working, I'm getting this error even after having installed the dependency.

image

Any way it could work with the atom editor?

marcofugaro avatar Mar 28 '18 09:03 marcofugaro

My first guess would be - does your project have prettier as a dependency, or are you relying on the copy of prettier bundled with prettier-atom? If prettier isn't a dependency of the project, the path ./node_modules... will be likely be resolved relative to the atom plugin, rather than the project's root.

tmcw avatar Mar 28 '18 15:03 tmcw

@tmcw yes, the project has a .prettierrc, prettier as a devDependency, and a prettier script in the package.json's scripts

marcofugaro avatar Mar 28 '18 15:03 marcofugaro

Try using an absolute path to the configuration instead of a relative one?

tmcw avatar Jul 10 '18 23:07 tmcw

Hey it works that way!

Sadly we can't commit that to the project's .prettierrc, it would be great it every editor could read from it.

marcofugaro avatar Jul 11 '18 09:07 marcofugaro