.scss-lint.yml 7.38 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:
Sam Rose's avatar
Sam Rose committed
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
    ignore_consecutive:
      - cursor
64

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Takuya Noguchi's avatar
Takuya Noguchi committed
185 186 187 188
  # Comment literals should be followed by a space.
  SpaceAfterComment:
    enabled: false

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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