UNPKG

1.28 kBMarkdownView Raw
1# selector-no-qualifying-type
2
3Disallow qualifying a selector by type.
4
5```css
6 a.foo {}
7/** ↑
8 * This type selector is qualifying the class */
9```
10
11A type selector is "qualifying" when it is compounded with (chained to) another selector (e.g. `a.foo`, `a#foo`). This rule does not regulate type selectors that are combined with other selectors via a combinator (e.g. `a > .foo`, `a #foo`).
12
13## Options
14
15### `true`
16
17The following patterns are considered violations:
18
19```css
20a.foo {
21 margin: 0
22}
23```
24
25```css
26a#foo {
27 margin: 0
28}
29```
30
31```css
32input[type='button'] {
33 margin: 0
34}
35```
36
37The following patterns are *not* considered violations:
38
39```css
40.foo {
41 margin: 0
42}
43```
44
45```css
46#foo {
47 margin: 0
48}
49```
50
51```css
52input {
53 margin: 0
54}
55```
56
57## Optional secondary options
58
59### `ignore: ["attribute", "class", "id"]`
60
61#### `"attribute"`
62
63Allow attribute selectors qualified by type.
64
65The following patterns are *not* considered violations:
66
67```css
68input[type='button'] {
69 margin: 0
70}
71```
72
73#### `"class"`
74
75Allow class selectors qualified by type.
76
77The following patterns are *not* considered violations:
78
79```css
80a.foo {
81 margin: 0
82}
83```
84
85#### `"id"`
86
87Allow ID selectors qualified by type.
88
89The following patterns are *not* considered violations:
90
91```css
92a#foo {
93 margin: 0
94}
95```