UNPKG

3.2 kBJavaScriptView Raw
1'use strict';
2
3module.exports = {
4 extends: 'stylelint-config-recommended',
5 rules: {
6 'alpha-value-notation': [
7 'percentage',
8 {
9 exceptProperties: [
10 'opacity',
11 'fill-opacity',
12 'flood-opacity',
13 'stop-opacity',
14 'stroke-opacity',
15 ],
16 },
17 ],
18 'at-rule-empty-line-before': [
19 'always',
20 {
21 except: ['blockless-after-same-name-blockless', 'first-nested'],
22 ignore: ['after-comment'],
23 },
24 ],
25 'at-rule-no-vendor-prefix': true,
26 'color-function-notation': 'modern',
27 'color-hex-length': 'short',
28 'comment-empty-line-before': [
29 'always',
30 {
31 except: ['first-nested'],
32 ignore: ['stylelint-commands'],
33 },
34 ],
35 'comment-whitespace-inside': 'always',
36 'custom-property-empty-line-before': [
37 'always',
38 {
39 except: ['after-custom-property', 'first-nested'],
40 ignore: ['after-comment', 'inside-single-line-block'],
41 },
42 ],
43 'custom-media-pattern': [
44 '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
45 {
46 message: (name) => `Expected custom media query name "${name}" to be kebab-case`,
47 },
48 ],
49 'custom-property-pattern': [
50 '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
51 {
52 message: (name) => `Expected custom property name "${name}" to be kebab-case`,
53 },
54 ],
55 'declaration-block-no-redundant-longhand-properties': true,
56 'declaration-block-single-line-max-declarations': 1,
57 'declaration-empty-line-before': [
58 'always',
59 {
60 except: ['after-declaration', 'first-nested'],
61 ignore: ['after-comment', 'inside-single-line-block'],
62 },
63 ],
64 'font-family-name-quotes': 'always-where-recommended',
65 'function-name-case': 'lower',
66 'function-url-quotes': 'always',
67 'hue-degree-notation': 'angle',
68 'import-notation': 'url',
69 'keyframe-selector-notation': 'percentage-unless-within-keyword-only-block',
70 'keyframes-name-pattern': [
71 '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
72 {
73 message: (name) => `Expected keyframe name "${name}" to be kebab-case`,
74 },
75 ],
76 'length-zero-no-unit': [
77 true,
78 {
79 ignore: ['custom-properties'],
80 },
81 ],
82 'lightness-notation': 'percentage',
83 'media-feature-name-no-vendor-prefix': true,
84 'media-feature-range-notation': 'context',
85 'number-max-precision': 4,
86 'property-no-vendor-prefix': true,
87 'rule-empty-line-before': [
88 'always-multi-line',
89 {
90 except: ['first-nested'],
91 ignore: ['after-comment'],
92 },
93 ],
94 'selector-attribute-quotes': 'always',
95 'selector-class-pattern': [
96 '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
97 {
98 message: (selector) => `Expected class selector "${selector}" to be kebab-case`,
99 },
100 ],
101 'selector-id-pattern': [
102 '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
103 {
104 message: (selector) => `Expected id selector "${selector}" to be kebab-case`,
105 },
106 ],
107 'selector-no-vendor-prefix': true,
108 'selector-not-notation': 'complex',
109 'selector-pseudo-element-colon-notation': 'double',
110 'selector-type-case': 'lower',
111 'shorthand-property-no-redundant-values': true,
112 'value-keyword-case': 'lower',
113 'value-no-vendor-prefix': [
114 true,
115 {
116 // `-webkit-box` is allowed as standard. See https://www.w3.org/TR/css-overflow-3/#webkit-line-clamp
117 ignoreValues: ['box', 'inline-box'],
118 },
119 ],
120 },
121};