|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- # 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 {}
- ```
|