Giter Club home page Giter Club logo

Comments (9)

kleinfreund avatar kleinfreund commented on June 10, 2024 1

jsPrettier.sublime-settings

{
    "debug": true,
    "prettier_cli_path": "/home/phil/.npm-global/lib/node_modules/prettier",
    "node_path": "/usr/bin/nodejs",
    "node_modules_path": "/home/phil/.npm-global/lib/node_modules"
}

I needed to tinker around with the settings a bit, because the plugin wasn’t working right out of the box.

There is no sublime project configuration active at the moment.

Also, there are no errors reported in the console.

from sublimejsprettier.

kleinfreund avatar kleinfreund commented on June 10, 2024 1

I get it to work pointing the CLI path to the prettier.js file directly.

With this setting I don’t need to specify the node_path anymore. I also removed the invalid key from my configuration.

{
    "prettier_cli_path": "/home/phil/.npm-global/lib/node_modules/prettier/bin/prettier.js"
}

Is this supposed to be like that?

from sublimejsprettier.

jonlabelle avatar jonlabelle commented on June 10, 2024

Are there any errors reported in the Sublime Text Console?

Can you post the contents of your User/JsPrettier.sublime-settings file, and if applicable your <project_name>.sublime-project file, as I am unable to reproduce the issue.

from sublimejsprettier.

jonlabelle avatar jonlabelle commented on June 10, 2024

And if your Prettier install isn't working... it goes without saying that the Sublime Text integration will not work. You definitely need to get Prettier working from the command-line first.

Though it is curious that the file is being emptied... and with no error indication in the plug-in.

Also... node_modules_path is not a valid JsPrettier setting.

from sublimejsprettier.

kleinfreund avatar kleinfreund commented on June 10, 2024

@jonlabelle I see. Prettier itself does work, though.

prettier --stdin --color=false --print-width 80 --single-quote=false --trailing-comma none --bracket-spacing=true --jsx-bracket-same-line=false --parser babylon --semi=true --tab-width 4 --use-tabs=false < ~/Desktop/x.js

Not setting prettier_cli_path results in The path to the Prettier cli executable could not be found!.

Setting prettier_cli_path to /home/phil/.npm-global/lib/node_modules/prettier solves that error but results in [Errno 13] Permission denied. Do the files within ~/.config/sublime-text-3/Packages/JsPrettier require any special permissions?

from sublimejsprettier.

jonlabelle avatar jonlabelle commented on June 10, 2024

@kleinfreund Do the files within ~/.config/sublime-text-3/Packages/JsPrettier require any special permissions?

not at all.

from sublimejsprettier.

jonlabelle avatar jonlabelle commented on June 10, 2024

I did add an additional sanity check to always ensure content is returned from stdout before replacing the source text.

from sublimejsprettier.

jt3k avatar jt3k commented on June 10, 2024

@kleinfreund I think so should not be.
sublime-js-prettier should work out of the box as well as from the console.

I have the same problem, and I also have a directory with global modules in the home directory ~/.npm-global/

Once again I run into difficulties setting up jsPrettier on every new Mac.

from sublimejsprettier.

lock avatar lock commented on June 10, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from sublimejsprettier.

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.