.scss-lint.yml 7.48 KB
Newer Older
1 2 3
# Linter Documentation:
# https://github.com/brigade/scss-lint/blob/master/lib/scss_lint/linter/README.md

4 5 6
scss_files:
  - 'app/assets/stylesheets/**/*.scss'
  - 'ee/app/assets/stylesheets/**/*.scss'
7 8 9 10 11

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

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

17
  # Whether or not to prefer `border: 0` over `border: none`.
18
  BorderZero:
19
    enabled: true
20

21 22 23 24 25 26 27
  # 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)
28 29
  ColorKeyword:
    enabled: false
30

31 32 33
  # Prefer color literals (keywords or hexadecimal codes) to be used only in
  # variable declarations. They should be referred to via variables everywhere
  # else.
34
  ColorVariable:
Sam Rose's avatar
Sam Rose committed
35
    enabled: true
36

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

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

45 46 47
  # Rule sets should be ordered as follows:
  # - @extend declarations
  # - @include declarations without inner @content
48 49
  # - properties
  # - @include declarations with inner @content
50
  # - nested rule sets.
Clement Ho's avatar
Clement Ho committed
51
  # Disabled to minimize Bootstrap migration footprint
52
  DeclarationOrder:
Clement Ho's avatar
Clement Ho committed
53
    enabled: false
54 55 56 57 58 59 60

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

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

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

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

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

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

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

95
  # Avoid using ID selectors.
96 97
  IdSelector:
    enabled: false
98

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

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

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

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

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

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

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

132
  # Always use placeholder selectors in @extend.
133 134 135
  PlaceholderInExtend:
    enabled: false

136
  # Sort properties in a strict order.
137 138
  PropertySortOrder:
    enabled: false
139

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

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

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

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

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

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

173 174 175 176 177 178
  # 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

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

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

Takuya Noguchi's avatar
Takuya Noguchi committed
188 189 190 191
  # Comment literals should be followed by a space.
  SpaceAfterComment:
    enabled: false

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

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

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

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

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

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

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

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

235
  # Reports lines containing trailing whitespace.
236
  TrailingWhitespace:
237
    enabled: true
238

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

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

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

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

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

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

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