Closed benjarrell closed 3 years ago
If you're using nc
you shouldn't need to manually set your netcat command. But if you still do, you'll need to set your command to nc -U
(or whatever option your specific netcat uses to trigger unix sockets). Let me know if that doesn't work for you.
I am getting the same result with the option removed. I added it after digging into the problem, as I have 2 different telnet commands as well as an ncat command that does not support -U
.
prettier --loglevel debug --check tier.rb
[debug] normalized argv: {"_":["tier.rb"],"check":true,"color":true,"editorconfig":true,"loglevel":"debug","config-precedence":"cli-override","debug-repeat":0,"ignore-path":".prettierignore","plugin":[],"plugin-search-dir":[]}
Checking formatting...
[debug] resolve config from 'tier.rb'
[debug] loaded options `null`
[debug] applied config-precedence (cli-override): {}
tier.rb[error] tier.rb: TypeError: Cannot read property 'toString' of null
[error] at parseSync (C:\local\yarnpkgs\global\node_modules\@prettier\plugin-ruby\src\parser\parseSync.js:130:34)
[error] at Object.parse (C:\local\yarnpkgs\global\node_modules\@prettier\plugin-ruby\src\ruby\parser.js:8:10)
[error] at Object.parse (C:\local\yarnpkgs\global\node_modules\prettier\index.js:13625:19)
[error] at coreFormat (C:\local\yarnpkgs\global\node_modules\prettier\index.js:14899:14)
[error] at format (C:\local\yarnpkgs\global\node_modules\prettier\index.js:15131:14)
[error] at Object.formatWithCursor (C:\local\yarnpkgs\global\node_modules\prettier\index.js:57542:12)
[error] at format (C:\local\yarnpkgs\global\node_modules\prettier\bin-prettier.js:15883:14)
[error] at Object.formatFiles (C:\local\yarnpkgs\global\node_modules\prettier\bin-prettier.js:16067:16)
[error] at Object.run (C:\local\yarnpkgs\global\node_modules\prettier\bin-prettier.js:16538:14)
[error] at Object.<anonymous> (C:\local\yarnpkgs\global\node_modules\prettier\bin-prettier.js:16553:5)
[error] at Module._compile (internal/modules/cjs/loader.js:1063:30)
[error] at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
[error] at Module.load (internal/modules/cjs/loader.js:928:32)
[error] at Function.Module._load (internal/modules/cjs/loader.js:769:14)
[error] at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
[error] at internal/main/run_main_module.js:17:47
All matched files use Prettier code style!
Looks like you're running on windows. I didn't even realize, but this is busted on windows since we switched to the unixserver. I'm working on support for it, tracking in https://github.com/prettier/plugin-ruby/pull/890
I am getting
TypeError: Cannot read property 'toString' of null
on all ruby files (that I have tried anyway, one example below). Other file formats work with Prettier as expected.Metadata
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x64-mingw32]
@prettier/plugin-ruby
version:@prettier/plugin-ruby@1.5.5
nc
All other options are the defaults.
v14.16.1
Input
Code snippet
Output
Running
prettier --ruby-netcat-command nc --loglevel debug --check tier.rb
gives me: