.scss-lint.yml 7.44 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
  BangFormat:
13
    enabled: true
14

15
  # Whether or not to prefer `border: 0` over `border: none`.
16
  BorderZero:
17
    enabled: true
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.
Clement Ho's avatar
Clement Ho committed
49
  # Disabled to minimize Bootstrap migration footprint
50
  DeclarationOrder:
Clement Ho's avatar
Clement Ho committed
51
    enabled: false
52 53 54 55 56 57 58

  # `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
59

60
  # Reports when you define the same property twice in a single rule set.
61
  DuplicateProperty:
62
    enabled: true
63 64
    ignore_consecutive:
      - cursor
65

66
  # Separate rule, function, and mixin declarations with empty lines.
67
  EmptyLineBetweenBlocks:
68
    enabled: true
69

70
  # Reports when you have an empty rule set.
71
  EmptyRule:
72
    enabled: true
73

74 75 76 77 78 79 80
  # 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.
81
  FinalNewline:
82 83
    enabled: true

84 85
  # HEX colors should use three-character values where possible.
  HexLength:
86
    enabled: false
87

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

93
  # Avoid using ID selectors.
94 95
  IdSelector:
    enabled: false
96

97 98
  # The basenames of @imported SCSS partials should not begin with an
  # underscore and should not include the filename extension.
99
  ImportPath:
100
    enabled: true
101

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

107 108 109 110
  # Indentation should always be done in increments of 2 spaces.
  Indentation:
    enabled: true
    width: 2
111

112
  # Don't write leading zeros for numeric values with a decimal point.
113 114
  LeadingZero:
    enabled: false
115

116
  # Reports when you define the same selector twice in a single sheet.
117
  MergeableSelector:
118
    enabled: true
119

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

125
  # Avoid nesting selectors too deeply.
126
  NestingDepth:
127 128
    enabled: true
    max_depth: 6
129

130
  # Always use placeholder selectors in @extend.
131 132 133
  PlaceholderInExtend:
    enabled: false

134
  # Sort properties in a strict order.
135 136
  PropertySortOrder:
    enabled: false
137

138 139
  # Reports when you use an unknown or disabled CSS property
  # (ignoring vendor-prefixed properties).
140
  PropertySpelling:
141
    enabled: true
142

143 144 145 146 147 148 149
  # 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.
150
  PseudoElement:
151
    enabled: true
152

153
  # Avoid qualifying elements in selectors (also known as "tag-qualifying").
154 155
  QualifyingElement:
    enabled: false
156

157
  # Don't write selectors with a depth of applicability greater than 3.
158 159
  SelectorDepth:
    enabled: false
160

161 162 163
  # Selectors should always use hyphenated-lowercase, rather than camelCase or
  # snake_case.
  SelectorFormat:
164
    enabled: false
165
    convention: hyphenated_lowercase
166

167 168 169
  # Prefer the shortest shorthand form possible for properties that support it.
  Shorthand:
    enabled: true
170

171 172 173 174 175 176
  # 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

177 178
  # Split selectors onto separate lines after each comma, and have each
  # individual selector occupy a single line.
179
  SingleLinePerSelector:
180
    enabled: true
181

182
  # Commas in lists should be followed by a space.
183
  SpaceAfterComma:
184
    enabled: true
185

186 187 188 189
  # Comment literals should be followed by a space.
  SpaceAfterComment:
    enabled: false

190 191 192 193 194 195 196 197 198
  # 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
199 200 201 202

  # Variables should be formatted with a single space separating the colon
  # from the variable's value.
  SpaceAfterVariableColon:
203
    enabled: true
204 205 206 207 208

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

210 211
  # Operators should be formatted with a single space on both sides of an
  # infix operator.
212
  SpaceAroundOperator:
213
    enabled: true
214

215
  # Opening braces should be preceded by a single space.
216
  SpaceBeforeBrace:
217
    enabled: true
218 219 220 221

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

223 224
  # Enforces that string literals should be written with a consistent form
  # of quotes (single or double).
225 226 227
  StringQuotes:
    enabled: false

228 229
  # Property values, @extend, @include, and @import directives, and variable
  # declarations should always end with a semicolon.
230
  TrailingSemicolon:
231
    enabled: true
232

233
  # Reports lines containing trailing whitespace.
234
  TrailingWhitespace:
235
    enabled: true
236

237 238 239 240 241 242 243 244 245
  # 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.
246
  UnnecessaryMantissa:
247
    enabled: true
248

249 250
  # Do not use parent selector references (&) when they would otherwise
  # be unnecessary.
251
  UnnecessaryParentReference:
252
    enabled: true
253

254 255
  # URLs should be valid and not contain protocols or domain names.
  UrlFormat:
256
    enabled: true
257 258 259

  # URLs should always be enclosed within quotes.
  UrlQuotes:
260
    enabled: true
261 262 263 264 265

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

267
  # Avoid vendor prefixes. Or rather: don't write them yourself.
268 269 270 271 272 273
  VendorPrefix:
    enabled: false

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