Sha256: 27a695ab4e2d9fbe5be04a2add028587fb538be78fad021e0ce0e58b3a338826

Contents?: true

Size: 1.27 KB

Versions: 24

Compression:

Stored size: 1.27 KB

Contents

# at-import-no-partial-leading-underscore

Disallow leading underscore in partial names in `@import`.

```scss
@import "path/to/_file"
/**              ↑
 *   Disallow this */
```

The rule ignores [cases](https://sass-lang.com/documentation/at-rules/import) when Sass considers an `@import` command just a plain CSS import:

* If the file’s 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.


The following patterns are considered warnings:

```scss
@import "_foo";
```

```scss
@import "path/_fff";
```

```scss
@import "path\\_fff"; /* Windows delimiters */
```

```scss
@import "df/fff", '_1.scss';
```

The following patterns are *not* considered warnings:

```scss
@import "_path/fff"; /* underscore in a directory name, not in a partial name */
```

```scss
@import url("path/_file.css"); /* has url(), so doesn't count as a partial @import */
```

```scss
@import "_file.css"; /* Has ".css" extension, so doesn't count as a partial @import */
```

```scss
/* Both are URIs, so don't count as partial @imports */
@import "http://_file.scss";
@import "//_file.scss";
```

```scss
@import "_file.scss" screen; /* Has a media query, so doesn't count as a partial @import */
```

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.7 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.6 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.5 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.4 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.3 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.2 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.1 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.3.5 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-5.0.0 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.3.4 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.3.3 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.3.2 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.3.1 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.3 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.2.3 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.2.2 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.2.1 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.2 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md
trusty-cms-4.1.9 node_modules/stylelint-scss/src/rules/at-import-no-partial-leading-underscore/README.md