1.0.2 • Published 8 years ago

stylelint-at-rule-import-path v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

stylelint-at-rule-import-path

Build Status

A custom stylelint rule to catch usage of @import statement underscores or filename extensions.

This rule will cause stylelint to warn you whenever @import include leading filenames underscores or filename extensions.

Installation

npm install stylelint-at-rule-import-path

This plugin is compatible with v5.0.1+.

Details

There are 2 options: allowUnderscore (true|false), allowExtension (true|false).

With default (no options specified):

@import('_variables); /* Not OK */
@import('variables); /* OK */

@import('path/_variables); /* Not OK */
@import('path/variables); /* OK */

@import('variables.scss); /* Not OK */
@import('variables); /* OK */

With allowUnderscore: true:

@import('_variables); /* OK */
@import('path/_variables); /* OK */

With allowExtension: true:

@import('variables.scss); /* OK */

Usage

Add "stylelint-at-rule-import-path" to your stylelint config plugins array, then add at-rule-import-path to your rules, set to your preferred options.

As follows:

{
  "plugins": [
    "stylelint-at-rule-import-path"
  ],
  "rules": {
    "at-rule-import-path": [true, {
      allowUnderscore: [true|false],
      allowExtension: [true|false]
    }]
  }
};