Comments (9)
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.
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.
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.
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.
@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.
@kleinfreund Do the files within ~/.config/sublime-text-3/Packages/JsPrettier require any special permissions?
not at all.
from sublimejsprettier.
I did add an additional sanity check to always ensure content is returned from stdout before replacing the source text.
from sublimejsprettier.
@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.
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)
- auto_format_on_save doesn't work with prettier-php, but my manual keybind does. HOT 2
- Saving a php document with cursor inside a script tag causes cursor to jump to top of document HOT 2
- Svelte support + bug HOT 4
- JsPrettier’s parser detection interferes with the Liquid Prettier plugin HOT 3
- Fails to work with ruby files using @prettier/plugin-ruby HOT 2
- Allow unsaved files to be formatted with prettier without saving HOT 4
- SyntaxError: Invalid or unexpected token HOT 6
- Problem formatting .svelte files HOT 3
- Add Support For ESLinter Configurations HOT 2
- Support not passing any Prettier config CLI options even when *not* using a Prettier config file HOT 3
- Crash when low on memory HOT 2
- JsPrettier cannot find plugin HOT 5
- Switch to `--log-level` Prettier CLI option name is needed HOT 2
- Prettier cannot find plugin HOT 6
- [Question] I could not format css, json... HOT 7
- JsPrettier doesn't run in appropriate context when used in monorepo context HOT 1
- Support ESM config files HOT 2
- Doesn't work when folder names use parentheses (Next.js route groups) HOT 7
- [error] Invalid configuration file: ENOENT: no such file or directory ... HOT 2
- [Bug] Configuration overrides are not honored HOT 2
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 sublimejsprettier.