A custom linter for SCSS-Lint that checks if function calls are being used instead of literals.
-
Clone this repo
-
And add its path to
plugin_directories
:
```yml
# SCSS-Lint configuration file
plugin_directories: ['./scss_lint_funcallforproperty']
```
This plugin is disabled by default.
The configuration works the same way as the default VariableForProperty plugin. So you can configure like this:
# SCSS-Lint configuration file
linters:
FuncallForProperty:
enabled: true
properties:
- z-index
The examples below show how SCSS-Lint behaves with that configuration:
div {
z-index: 100;
}
div {
z-index: map-get($depth-map, 'highest');
}
Note that values like currentColor
, inherit
, initial
, and transparent
will not be reported, as they are special kinds of values that convey additional meaning.
Configuration Option | Description |
---|---|
properties |
Array of property names to check |
This project is released under the MIT license.
Renan Couto