renancouto / scss_lint_funcallforproperty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function Call for Property

A custom linter for SCSS-Lint that checks if function calls are being used instead of literals.

Installation

  1. Clone this repo

  2. And add its path to plugin_directories:

```yml
# SCSS-Lint configuration file
plugin_directories: ['./scss_lint_funcallforproperty']
```

Configuration

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:

😞 Bad

div {
  z-index: 100;
}

😄 Good

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

License

This project is released under the MIT license.

Author

Renan Couto

About

License:Other


Languages

Language:Ruby 100.0%