mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
chore(lint): add custom sass linter to require !default
This commit is contained in:
@ -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
|
||||||
|
|
||||||
|
12
.scss-linters/default_rule.rb
Normal file
12
.scss-linters/default_rule.rb
Normal 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
|
Reference in New Issue
Block a user