notes/node_modules/stylelint-scss/src/rules/at-import-partial-extension.../README.md

1.5 KiB
Raw Blame History

at-import-partial-extension-whitelist

Specify whitelist of allowed file extensions for partial names in @import commands.

@import "file.scss"
/**           ↑
 * Whitelist of these */

The rule ignores cases when Sass considers an @import command just a plain CSS import:

  • If the files extension is .css.
  • If the filename begins with http:// (or any other protocol).
  • If the filename is a url().
  • If the @import has any media queries.

Options

array: ["array", "of", "extensions"]

Each value is either a string or a regexp.

Given:

["scss", /less/]

The following patterns are considered warnings:

@import "file.sass";
@import "file1", "file.stylus";

The following patterns are not considered warnings:

@import "path/fff";
@import "foo.scss";
@import "path/fff.less";
@import "path\\fff.ruthless";
@import "df/fff", '1.SCSS';
@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */
@import "file.css"; /* Has ".css" extension, so doesn't count as a partial @import */
/* Both are URIs, so don't count as partial @imports */
@import "http://_file.scss";
@import "//_file.scss";
@import "file.scss" screen; /* Has a media query, so doesn't count as a partial @import */