Figure out & document how to disable RuboCop's styling rules
See original GitHub issueWelcome to the prettier org! So awesome.
As this project likely to live along-side RuboCop in Ruby projects we’ll need to either document how to ensure that the two projects don’t clash, or build something similar to https://github.com/prettier/eslint-plugin-prettier to ensure the two don’t step on each others toes.
Ideas:
- https://github.com/rubocop-hq/rubocop/issues/6750 I just asked for their advice
- https://github.com/rubocop-hq/rubocop/issues/5678 disable all
Style/*
- https://rubocop.readthedocs.io/en/latest/configuration/#inheriting-configuration-from-a-remote-url inherit a config that could ship with prettier (could have RuboCop version mismatches)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:22 (13 by maintainers)
Top Results From Across the Web
Configuration :: RuboCop Docs
Running rubocop --autocorrect --disable-uncorrectable will create comments to disable all offenses that can't be automatically corrected.
Read more >Rubocop, how to Disable/Enable cops on blocks of code
I answer my question because it is always very difficult for me to find the reference to this solution: # rubocop:disable ...
Read more >[Fix] Missing Top Level Class Documentation Comment ...
This post shows three different ways to fix rubocop missing comment or disable warning: "Missing top-level class documentation comment".
Read more >RuboCop | RubyMine Documentation - JetBrains
Go to the Editor | Inspections page and enable/disable the RuboCop inspection under Ruby | Gems and gem management. If necessary, enable the...
Read more >Rubocop - 4 ways to reduce your frustration! | Hanami Mastery
First thing that come to my mind when I'm forcing my brain to figure out ... code-style rules, you find yourself the only...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This project could ship a gem called like
rubocop-config-prettier
that containsrubocop.yml
files disabling the style rules. Then projects wanting to Prettier along with Rubocop could useinherit_gem
to inherit the config:This would be like how ESLint users have to install a config plugin and update their ESLint config files to integrate with Prettier. I like the idea of shipping a gem containing a config better because it feels more “right” to install Rubocop config using gems instead of npm.
To solve the Rubocop version compatibility issue, if there are versions of Rubocop that introduce config file incompatibilities, the
rubocop-config-prettier
gem could start shipping alternate rubocop.yml files tailored to different versions. So say starting Rubocop 0.45 there’s a compatibility change, the gem could start including a rubocop-0.44.yml file that would work for versions of Rubocop before the change, and rubocop.yml would be for the latest version.@flyerhzm sorry I’m not sure I understand why you would want to pull in a separate gem, why wouldn’t you just open a PR here?