Showing 1,727 of 1,727 total issues
Selector browser-window__button
should be written in lowercase with hyphens Open
.browser-window__button {
- Exclude checks
Properties should be ordered height, margin, top, width Open
top: 0;
- Exclude checks
!important should not be used Open
border-bottom: 5px solid $primary-darker !important;
- Exclude checks
0.23
should be written without a leading zero as .23
Open
padding-right: 0.23rem;
- Exclude checks
Property background
already defined on line 74 Open
background: url(image-path('svgs/if_user_981085.svg'));
- Exclude checks
Properties should be ordered border-bottom, padding-bottom Open
padding-bottom: .62rem;
- Exclude checks
0.75
should be written without a leading zero as .75
Open
padding: 0.375rem 1.5rem 0.375rem 0.75rem;
- Exclude checks
Properties should be ordered border-bottom, border-top, height, margin-bottom Open
margin-bottom: -2px; // To hide the footer's border top.
- Exclude checks
Selector roles-user__avatar
should be written in lowercase with hyphens Open
.roles-user__avatar {
- Exclude checks
Properties should be ordered flex-direction, margin-bottom, margin-top Open
margin-top: 4.9rem;
- Exclude checks
Properties should be ordered margin-bottom, margin-left, margin-right Open
margin-left: 1.5rem;
- Exclude checks
Properties should be ordered padding-bottom, padding-top Open
padding-top: 6rem;
- Exclude checks
Use match?
instead of =~
when MatchData
is not used. Open
unless value =~ VALID_EMAIL_REGEX
- Read upRead up
- Exclude checks
In Ruby 2.4, String#match?
, Regexp#match?
and Symbol#match?
have been added. The methods are faster than match
.
Because the methods avoid creating a MatchData
object or saving
backref.
So, when MatchData
is not used, use match?
instead of match
.
Example:
# bad
def foo
if x =~ /re/
do_something
end
end
# bad
def foo
if x.match(/re/)
do_something
end
end
# bad
def foo
if /re/ === x
do_something
end
end
# good
def foo
if x.match?(/re/)
do_something
end
end
# good
def foo
if x =~ /re/
do_something(Regexp.last_match)
end
end
# good
def foo
if x.match(/re/)
do_something($~)
end
end
# good
def foo
if /re/ === x
do_something($~)
end
end
Missing top-level class documentation comment. Open
class ImageUploader < CarrierWave::Uploader::Base
- Read upRead up
- Exclude checks
This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.
The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.
Example:
# bad
class Person
# ...
end
# good
# Description/Explanation of Person class
class Person
# ...
end
Missing magic comment # frozen_string_literal: true
. Open
source 'https://rubygems.org'
- Read upRead up
- Exclude checks
This cop is designed to help upgrade to Ruby 3.0. It will add the
comment # frozen_string_literal: true
to the top of files to
enable frozen string literals. Frozen string literals may be default
in Ruby 3.0. The comment will be added below a shebang and encoding
comment. The frozen string literal comment is only valid in Ruby 2.3+.
Example: EnforcedStyle: when_needed (default)
# The `when_needed` style will add the frozen string literal comment
# to files only when the `TargetRubyVersion` is set to 2.3+.
# bad
module Foo
# ...
end
# good
# frozen_string_literal: true
module Foo
# ...
end
Example: EnforcedStyle: always
# The `always` style will always add the frozen string literal comment
# to a file, regardless of the Ruby version or if `freeze` or `<<` are
# called on a string literal.
# bad
module Bar
# ...
end
# good
# frozen_string_literal: true
module Bar
# ...
end
Example: EnforcedStyle: never
# The `never` will enforce that the frozen string literal comment does
# not exist in a file.
# bad
# frozen_string_literal: true
module Baz
# ...
end
# good
module Baz
# ...
end
!important should not be used Open
background-color: $light-background !important;
- Exclude checks
Properties should be ordered border-bottom-left-radius, border-top-right-radius Open
border-top-right-radius: 0 !important;
- Exclude checks
!important should not be used Open
border-top-right-radius: 0 !important;
- Exclude checks
Properties should be ordered color, height, left, position, top, width Open
position: absolute;
- Exclude checks
Colon after property should be followed by one space Open
-moz-box-sizing: border-box;
- Exclude checks