.scss-lint.yml 7.25 KB
Newer Older
1 2 3 4 5 6 7 8 9
# Linter Documentation:
# https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/README.md

scss_files: 'app/assets/stylesheets/**/*.scss'

exclude:
  - 'app/assets/stylesheets/pages/emojis.scss'

linters:
10 11
  # Reports when you use improper spacing around ! (the "bang") in !default,
  # !global, !important, and !optional flags.
12 13
  BangFormat:
    enabled: false
14

15
  # Whether or not to prefer `border: 0` over `border: none`.
16 17
  BorderZero:
    enabled: false
18

19 20 21 22 23 24 25
  # Reports when you define a rule set using a selector with chained classes
  # (a.k.a. adjoining classes).
  ChainedClasses:
    enabled: false

  # Prefer hexadecimal color codes over color keywords.
  # (e.g. `color: green` is a color keyword)
26 27
  ColorKeyword:
    enabled: false
28

29 30 31
  # Prefer color literals (keywords or hexadecimal codes) to be used only in
  # variable declarations. They should be referred to via variables everywhere
  # else.
32
  ColorVariable:
33
    enabled: true
34

35
  # Which form of comments to prefer in CSS.
36 37
  Comment:
    enabled: false
38 39 40 41

  # Reports @debug statements (which you probably left behind accidentally).
  DebugStatement:
    enabled: false
42

43 44 45
  # Rule sets should be ordered as follows:
  # - @extend declarations
  # - @include declarations without inner @content
46 47
  # - properties
  # - @include declarations with inner @content
48
  # - nested rule sets.
49
  DeclarationOrder:
50
    enabled: true
51 52 53 54 55 56 57

  # `scss-lint:disable` control comments should be preceded by a comment
  # explaining why these linters are being disabled for this file.
  # See https://github.com/brigade/scss-lint#disabling-linters-via-source for
  # more information.
  DisableLinterReason:
    enabled: true
58

59
  # Reports when you define the same property twice in a single rule set.
60
  DuplicateProperty:
61
    enabled: true
62

63
  # Separate rule, function, and mixin declarations with empty lines.
64
  EmptyLineBetweenBlocks:
65
    enabled: true
66

67
  # Reports when you have an empty rule set.
68
  EmptyRule:
69
    enabled: true
70

71 72 73 74 75 76 77
  # Reports when you have an @extend directive.
  ExtendDirective:
    enabled: false

  # Files should always have a final newline. This results in better diffs
  # when adding lines to the file, since SCM systems such as git won't
  # think that you touched the last line.
78
  FinalNewline:
79 80
    enabled: true

81 82
  # HEX colors should use three-character values where possible.
  HexLength:
83
    enabled: false
84

85 86 87 88
  # HEX color values should use lower-case colors to differentiate between
  # letters and numbers, e.g. `#E3E3E3` vs. `#e3e3e3`.
  HexNotation:
    enabled: true
89

90
  # Avoid using ID selectors.
91 92
  IdSelector:
    enabled: false
93

94 95
  # The basenames of @imported SCSS partials should not begin with an
  # underscore and should not include the filename extension.
96 97
  ImportPath:
    enabled: false
98

99 100
  # Avoid using !important in properties. It is usually indicative of a
  # misunderstanding of CSS specificity and can lead to brittle code.
101 102
  ImportantRule:
    enabled: false
103

104 105 106 107
  # Indentation should always be done in increments of 2 spaces.
  Indentation:
    enabled: true
    width: 2
108

109
  # Don't write leading zeros for numeric values with a decimal point.
110 111
  LeadingZero:
    enabled: false
112

113
  # Reports when you define the same selector twice in a single sheet.
114 115
  MergeableSelector:
    enabled: false
116

117 118
  # Functions, mixins, variables, and placeholders should be declared
  # with all lowercase letters and hyphens instead of underscores.
119 120
  NameFormat:
    enabled: false
121

122
  # Avoid nesting selectors too deeply.
123 124 125
  NestingDepth:
    enabled: false

126
  # Always use placeholder selectors in @extend.
127 128 129
  PlaceholderInExtend:
    enabled: false

130
  # Sort properties in a strict order.
131 132
  PropertySortOrder:
    enabled: false
133

134 135
  # Reports when you use an unknown or disabled CSS property
  # (ignoring vendor-prefixed properties).
136 137
  PropertySpelling:
    enabled: false
138

139 140 141 142 143 144 145
  # Configure which units are allowed for property values.
  PropertyUnits:
    enabled: false

  # Pseudo-elements, like ::before, and ::first-letter, should be declared
  # with two colons. Pseudo-classes, like :hover and :first-child, should
  # be declared with one colon.
146
  PseudoElement:
147
    enabled: true
148

149
  # Avoid qualifying elements in selectors (also known as "tag-qualifying").
150 151
  QualifyingElement:
    enabled: false
152

153
  # Don't write selectors with a depth of applicability greater than 3.
154 155
  SelectorDepth:
    enabled: false
156

157 158 159
  # Selectors should always use hyphenated-lowercase, rather than camelCase or
  # snake_case.
  SelectorFormat:
160
    enabled: false
161
    convention: hyphenated_lowercase
162

163 164 165
  # Prefer the shortest shorthand form possible for properties that support it.
  Shorthand:
    enabled: true
166

167 168 169 170 171 172
  # Each property should have its own line, except in the special case of
  # single line rulesets.
  SingleLinePerProperty:
    enabled: true
    allow_single_line_rule_sets: true

173 174
  # Split selectors onto separate lines after each comma, and have each
  # individual selector occupy a single line.
175
  SingleLinePerSelector:
176
    enabled: true
177

178
  # Commas in lists should be followed by a space.
179 180
  SpaceAfterComma:
    enabled: false
181

182 183 184 185 186 187 188 189 190
  # Properties should be formatted with a single space separating the colon
  # from the property's value.
  SpaceAfterPropertyColon:
    enabled: true

  # Properties should be formatted with no space between the name and the
  # colon.
  SpaceAfterPropertyName:
    enabled: true
191 192 193 194

  # Variables should be formatted with a single space separating the colon
  # from the variable's value.
  SpaceAfterVariableColon:
195
    enabled: true
196 197 198 199 200

  # Variables should be formatted with no space between the name and the
  # colon.
  SpaceAfterVariableName:
    enabled: false
201

202 203
  # Operators should be formatted with a single space on both sides of an
  # infix operator.
204
  SpaceAroundOperator:
205
    enabled: true
206

207
  # Opening braces should be preceded by a single space.
208
  SpaceBeforeBrace:
209
    enabled: true
210 211 212 213

  # Parentheses should not be padded with spaces.
  SpaceBetweenParens:
    enabled: false
214

215 216
  # Enforces that string literals should be written with a consistent form
  # of quotes (single or double).
217 218 219
  StringQuotes:
    enabled: false

220 221
  # Property values, @extend, @include, and @import directives, and variable
  # declarations should always end with a semicolon.
222
  TrailingSemicolon:
223
    enabled: true
224

225
  # Reports lines containing trailing whitespace.
226
  TrailingWhitespace:
227
    enabled: true
228

229 230 231 232 233 234 235 236 237
  # Don't write trailing zeros for numeric values with a decimal point.
  TrailingZero:
    enabled: false

  # Don't use the `all` keyword to specify transition properties.
  TransitionAll:
    enabled: false

  # Numeric values should not contain unnecessary fractional portions.
238 239 240
  UnnecessaryMantissa:
    enabled: false

241 242
  # Do not use parent selector references (&) when they would otherwise
  # be unnecessary.
243 244
  UnnecessaryParentReference:
    enabled: false
245

246 247
  # URLs should be valid and not contain protocols or domain names.
  UrlFormat:
248
    enabled: true
249 250 251

  # URLs should always be enclosed within quotes.
  UrlQuotes:
252
    enabled: true
253 254 255 256 257

  # Properties, like color and font, are easier to read and maintain
  # when defined using variables rather than literals.
  VariableForProperty:
    enabled: false
258

259
  # Avoid vendor prefixes. Or rather: don't write them yourself.
260 261 262 263 264 265
  VendorPrefix:
    enabled: false

  # Omit length units on zero values, e.g. `0px` vs. `0`.
  ZeroUnit:
    enabled: true