Hi, I maintain an editor package that configures and runs code formatters. My CI installs supported code formatters and runs them to ensure they work with the provided configuration. Recently the Ruby plugin for Prettier has stopped working in my CI and I've been unable to figure out why. Here's a Dockerfile that reproduces the issue:
FROM ubuntu:20.04
RUN apt-get update
RUN apt-get install -y ca-certificates curl gnupg lsb-release
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN echo "deb [arch=amd64] https://deb.nodesource.com/node_20.x focal main" | tee /etc/apt/sources.list.d/nodejs.list
RUN apt-get update
RUN apt-get install -y nodejs
RUN apt-get install -y ruby ruby-dev
RUN apt-get install -y gcc make
RUN gem install rbs -v 3.1.3
RUN gem install prettier_print
RUN gem install syntax_tree
RUN gem install syntax_tree-haml
RUN gem install syntax_tree-rbs
RUN npm install -g prettier @prettier/plugin-ruby
RUN echo "puts 'hello world'" | prettier --stdin-filepath=main.rb --parser=ruby
What am I missing about the dependencies here? It seems like @prettier/plugin-ruby is not detected by prettier despite being installed. Changing --parser=ruby to --parser=@prettier/plugin-ruby produces the same result (Couldn't resolve parser "@prettier/plugin-ruby").
Let me know if this is an issue further upstream (e.g., with Prettier or NPM), or if it's a configuration problem on my end.
Hi, I maintain an editor package that configures and runs code formatters. My CI installs supported code formatters and runs them to ensure they work with the provided configuration. Recently the Ruby plugin for Prettier has stopped working in my CI and I've been unable to figure out why. Here's a Dockerfile that reproduces the issue:
(Un)expected output:
What am I missing about the dependencies here? It seems like
@prettier/plugin-ruby
is not detected byprettier
despite being installed. Changing--parser=ruby
to--parser=@prettier/plugin-ruby
produces the same result (Couldn't resolve parser "@prettier/plugin-ruby"
).Let me know if this is an issue further upstream (e.g., with Prettier or NPM), or if it's a configuration problem on my end.