BigW Consortium Gitlab

.scss-lint.yml 7.33 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 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
  ImportPath:
97
    enabled: true
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
  PropertySpelling:
137
    enabled: true
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
  SpaceAfterComma:
180
    enabled: true
181

182 183 184 185
  # Comment literals should be followed by a space.
  SpaceAfterComment:
    enabled: false

186 187 188 189 190 191 192 193 194
  # 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
195 196 197 198

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

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

206 207
  # Operators should be formatted with a single space on both sides of an
  # infix operator.
208
  SpaceAroundOperator:
209
    enabled: true
210

211
  # Opening braces should be preceded by a single space.
212
  SpaceBeforeBrace:
213
    enabled: true
214 215 216 217

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

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

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

229
  # Reports lines containing trailing whitespace.
230
  TrailingWhitespace:
231
    enabled: true
232

233 234 235 236 237 238 239 240 241
  # 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.
242 243 244
  UnnecessaryMantissa:
    enabled: false

245 246
  # Do not use parent selector references (&) when they would otherwise
  # be unnecessary.
247
  UnnecessaryParentReference:
248
    enabled: true
249

250 251
  # URLs should be valid and not contain protocols or domain names.
  UrlFormat:
252
    enabled: true
253 254 255

  # URLs should always be enclosed within quotes.
  UrlQuotes:
256
    enabled: true
257 258 259 260 261

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

263
  # Avoid vendor prefixes. Or rather: don't write them yourself.
264 265 266 267 268 269
  VendorPrefix:
    enabled: false

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