Created
January 29, 2026 09:50
-
-
Save kinjouj/cb6fdb05b3a6e9907b81c6ed28e75016 to your computer and use it in GitHub Desktop.
rubocop no unless plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module RuboCop | |
| module Cop | |
| module Style | |
| class NoUnless < Base | |
| MSG = 'Do not use `unless`. Use `if !` instead.' | |
| def on_if(node) | |
| return unless node.unless? | |
| add_offense(node) | |
| end | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment