Sha256: ba694073f1bee2482d02d85f846688e0e8cd8b0f1dbfb6917eefae3e8c46abcc

Contents?: true

Size: 1.91 KB

Versions: 24

Compression:

Stored size: 1.91 KB

Contents

# selector-type-no-unknown

Disallow unknown type selectors.

<!-- prettier-ignore -->
```css
    unknown {}
/** ↑
 * This type selector */
```

This rule considers tags defined in the HTML, SVG, and MathML specifications to be known.

## Options

### `true`

The following patterns are considered violations:

<!-- prettier-ignore -->
```css
unknown {}
```

<!-- prettier-ignore -->
```css
tag {}
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
input {}
```

<!-- prettier-ignore -->
```css
ul li {}
```

<!-- prettier-ignore -->
```css
li > a {}
```

## Optional secondary options

### `ignore: ["custom-elements", "default-namespace"]`

#### `"custom-elements"`

Allow custom elements.

The following patterns are considered violations:

<!-- prettier-ignore -->
```css
unknown {}
```

<!-- prettier-ignore -->
```css
x-Foo {}
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
x-foo {}
```

#### `"default-namespace"`

Allow unknown type selectors if they belong to the default namespace.

The following patterns are considered violations:

<!-- prettier-ignore -->
```css
namespace|unknown {}
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
unknown {}
```

### `ignoreNamespaces: ["/regex/", /regex/, "string"]`

Given:

```
["/^my-/", "custom-namespace"]
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
custom-namespace|unknown {}
```

<!-- prettier-ignore -->
```css
my-namespace|unknown {}
```

<!-- prettier-ignore -->
```css
my-other-namespace|unknown {}
```

### `ignoreTypes: ["/regex/", /regex/, "string"]`

Given:

```
["/^my-/", "custom-type"]
```

The following patterns are _not_ considered violations:

<!-- prettier-ignore -->
```css
custom-type {}
```

<!-- prettier-ignore -->
```css
my-type {}
```

<!-- prettier-ignore -->
```css
my-other-type {}
```

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
trusty-cms-6.3.1 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.7 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.6 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.5 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.4 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.3 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.2 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.1 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.3.5 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-5.0.0 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.3.4 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.3.3 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.3.2 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.3.1 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.3 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.2.3 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.2.2 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.2.1 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.2 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md
trusty-cms-4.1.9 node_modules/stylelint/lib/rules/selector-type-no-unknown/README.md