chore(lint): add custom sass linter to require !default

This commit is contained in:
Brandy Carney
2017-06-05 13:44:06 -04:00
parent 59a1e3def1
commit 64cac79da6
2 changed files with 17 additions and 0 deletions

View File

@ -2,6 +2,8 @@
# See config at https://github.com/brigade/scss-lint/blob/master/config/default.yml # See config at https://github.com/brigade/scss-lint/blob/master/config/default.yml
plugin_directories: ['.scss-linters']
exclude: exclude:
- 'src/components/item/item.ios.scss' - 'src/components/item/item.ios.scss'
- 'src/components/item/item.md.scss' - 'src/components/item/item.md.scss'
@ -19,6 +21,9 @@ linters:
ColorVariable: ColorVariable:
enabled: false enabled: false
DefaultRule:
enabled: false
DuplicateProperty: DuplicateProperty:
enabled: false enabled: false

View File

@ -0,0 +1,12 @@
module SCSSLint
# Reports the use of !important in properties.
class Linter::DefaultRule < Linter
include LinterRegistry
def visit_variable(node)
return if source_from_range(node.source_range).include?('!default')
add_lint(node, '!default should be used')
end
end
end