1.5k sao GitHub và vẫn tăng — prettier/plugin-ruby là dự án JavaScript mà TopGit đang theo dõi trên nền tảng. Prettier Ruby Plugin
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
@prettier/plugin-ruby is a prettier plugin for the Ruby programming language and its ecosystem. prettier is an opinionated code formatter that supports multiple languages and integrates with most editors. The idea is to eliminate discussions of style in code review and allow developers to get back to thinking about code design instead.
when run through @prettier/plugin-ruby will generate:
d = [
30_644_250_780,
9_003_106_878,
30_636_278_846,
66_641_217_692,
4_501_790_980,
671_24_603036,
131_61973916,
66_606629_920,
30_642_677_916,
30_643_069_058
]
a, s = [], $*[0]
s.each_byte { |b| a << ("%036b" % d[b.chr.to_i]).scan(/\d{6}/) }
a.transpose.each do |a|
a.join.each_byte { |i| print i == 49 ? ($*[1] || "#") : 32.chr }
puts
end
Getting started
The @prettier/plugin-ruby plugin for prettier is a small wrapper around the Syntax Tree gem that provides a Ruby formatter for prettier. It does this by keeping a Ruby server running in that background that prettier can communicate with when it needs to format a Ruby file. This means that in order to function, you will need to have both the requisite node and ruby dependencies installed. Because of this configuration, there are a couple of ways that you can get setup to use this plugin.
If you're already using prettier in your project to format other files in your project and want to install this as a plugin, you can install it using npm.
If you're not using prettier yet in your project, then we recommend using the Syntax Tree gem directly instead of using this plugin.
Note that this plugin also ships a gem named prettier which is a wrapper around the prettier CLI and includes this plugin by default, but we no longer recommend its use. If you're using that gem, you should migrate to using Syntax Tree instead.
To run prettier with the Ruby plugin as an npm package, you're going to need ruby (version 2.7 or newer) and node (version 16 or newer).
If you're using the npm CLI, then add the plugin by:
Sometimes you want to leave your formatting in place and have prettier not format it, but continue to format the rest of the file. prettier has the ability to do this with prettier-ignore comments, but because the underlying formatter for this plugin is Syntax Tree, you instead would use a stree-ignore comment.
Usage with RuboCop
RuboCop and Prettier for Ruby serve different purposes, but there is overlap with some of RuboCop's functionality. Prettier provides a RuboCop configuration file to disable the rules which would clash. To enable this file, add the following configuration at the top of your project's .rubocop.yml:
For supported editor integrations, you should follow the instructions for installing the integration, then install the npm version of this plugin as a development dependency of your project. For most integrations, that should be sufficient. For convenience, the instructions for integrating with VSCode are used as an example below:
Install the Prettier - Code Formatter extension.
Add the npm @prettier/plugin-ruby package to your project as described above.
Configure in your settings.json (formatOnSave is optional):
prettier/plugin-ruby thuộc nhóm Backend trên TopGit, cùng 3 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về prettier/plugin-ruby ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/prettier/plugin-ruby là nguồn chính thức.
prettier/plugin-ruby có phải mã nguồn mở không?
Có — prettier/plugin-ruby phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/prettier/plugin-ruby.
prettier/plugin-ruby có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho prettier/plugin-ruby. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
prettier/plugin-ruby dùng license gì?
prettier/plugin-ruby phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
prettier/plugin-ruby là gì?
prettier/plugin-ruby (prettier/plugin-ruby) là dự án JavaScript trên GitHub. Theo mô tả gốc: Prettier Ruby Plugin
Vì sao prettier/plugin-ruby được xếp vào nhóm Backend?
TopGit xếp prettier/plugin-ruby vào nhóm Backend dựa trên GitHub topics và mô tả của repo (gắn thẻ: "prettier", "prettier-plugin", "ruby"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
plugin-ruby có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về plugin-ruby.