@readme/stylelint-config 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js ADDED
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ extends: ['@readme/eslint-config', '@readme/eslint-config/testing'],
3
+ };
package/CHANGELOG.md ADDED
@@ -0,0 +1,262 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [3.2.2](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.2.1...@readme/stylelint-config@3.2.2) (2023-07-05)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **stylelint-config:** disable media-query-no-invalid rule ([#700](https://github.com/readmeio/standards/issues/700)) ([c6cfebd](https://github.com/readmeio/standards/commit/c6cfebdacf63b5f8cc73ee06d79dcac8a66d945c))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.2.1](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.2.0...@readme/stylelint-config@3.2.1) (2023-07-05)
18
+
19
+ **Note:** Version bump only for package @readme/stylelint-config
20
+
21
+
22
+
23
+
24
+
25
+ # [3.2.0](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.19...@readme/stylelint-config@3.2.0) (2023-06-30)
26
+
27
+
28
+ ### Features
29
+
30
+ * **stylelint-config:** add rules from our main readme repo ([#686](https://github.com/readmeio/standards/issues/686)) ([556183e](https://github.com/readmeio/standards/commit/556183e8f0609b28cedef18e239c2e600718a702))
31
+
32
+
33
+
34
+
35
+
36
+ ## [3.1.19](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.18...@readme/stylelint-config@3.1.19) (2023-06-06)
37
+
38
+ **Note:** Version bump only for package @readme/stylelint-config
39
+
40
+
41
+
42
+
43
+
44
+ ## [3.1.18](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.17...@readme/stylelint-config@3.1.18) (2023-06-01)
45
+
46
+ **Note:** Version bump only for package @readme/stylelint-config
47
+
48
+
49
+
50
+
51
+
52
+ ## [3.1.17](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.16...@readme/stylelint-config@3.1.17) (2023-05-26)
53
+
54
+ **Note:** Version bump only for package @readme/stylelint-config
55
+
56
+
57
+
58
+
59
+
60
+ ## [3.1.16](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.15...@readme/stylelint-config@3.1.16) (2023-04-01)
61
+
62
+ **Note:** Version bump only for package @readme/stylelint-config
63
+
64
+
65
+
66
+
67
+
68
+ ## [3.1.15](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.14...@readme/stylelint-config@3.1.15) (2023-03-02)
69
+
70
+ **Note:** Version bump only for package @readme/stylelint-config
71
+
72
+
73
+
74
+
75
+
76
+ ## [3.1.14](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.13...@readme/stylelint-config@3.1.14) (2023-01-23)
77
+
78
+ **Note:** Version bump only for package @readme/stylelint-config
79
+
80
+
81
+
82
+
83
+
84
+ ## [3.1.13](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.12...@readme/stylelint-config@3.1.13) (2023-01-18)
85
+
86
+ **Note:** Version bump only for package @readme/stylelint-config
87
+
88
+
89
+
90
+
91
+
92
+ ## [3.1.12](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.11...@readme/stylelint-config@3.1.12) (2023-01-12)
93
+
94
+
95
+ ### Bug Fixes
96
+
97
+ * pinning eslint-plugin-import to 2.26 ([b16cd44](https://github.com/readmeio/standards/commit/b16cd44c4dddca2ef323aea5015525c2a25657e9))
98
+
99
+
100
+
101
+
102
+
103
+ ## [3.1.11](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.10...@readme/stylelint-config@3.1.11) (2023-01-12)
104
+
105
+
106
+ ### Bug Fixes
107
+
108
+ * downgrading eslint-plugin-import, 2.27 has regressions ([a069a0b](https://github.com/readmeio/standards/commit/a069a0badaefbe17513a96be192f99936558d6ee))
109
+
110
+
111
+
112
+
113
+
114
+ ## [3.1.10](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.9...@readme/stylelint-config@3.1.10) (2023-01-12)
115
+
116
+ **Note:** Version bump only for package @readme/stylelint-config
117
+
118
+
119
+
120
+
121
+
122
+ ## [3.1.9](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.8...@readme/stylelint-config@3.1.9) (2023-01-11)
123
+
124
+ **Note:** Version bump only for package @readme/stylelint-config
125
+
126
+
127
+
128
+
129
+
130
+ ## [3.1.8](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.7...@readme/stylelint-config@3.1.8) (2023-01-11)
131
+
132
+ **Note:** Version bump only for package @readme/stylelint-config
133
+
134
+
135
+
136
+
137
+
138
+ ## [3.1.7](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.6...@readme/stylelint-config@3.1.7) (2023-01-03)
139
+
140
+ **Note:** Version bump only for package @readme/stylelint-config
141
+
142
+
143
+
144
+
145
+
146
+ ## [3.1.6](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.5...@readme/stylelint-config@3.1.6) (2022-12-04)
147
+
148
+ **Note:** Version bump only for package @readme/stylelint-config
149
+
150
+
151
+
152
+
153
+
154
+ ## [3.1.5](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.4...@readme/stylelint-config@3.1.5) (2022-12-04)
155
+
156
+ **Note:** Version bump only for package @readme/stylelint-config
157
+
158
+
159
+
160
+
161
+
162
+ ## [3.1.4](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.3...@readme/stylelint-config@3.1.4) (2022-11-17)
163
+
164
+ **Note:** Version bump only for package @readme/stylelint-config
165
+
166
+ ## [3.1.3](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.2...@readme/stylelint-config@3.1.3) (2022-11-04)
167
+
168
+ **Note:** Version bump only for package @readme/stylelint-config
169
+
170
+ ## [3.1.2](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.1...@readme/stylelint-config@3.1.2) (2022-11-01)
171
+
172
+ **Note:** Version bump only for package @readme/stylelint-config
173
+
174
+ ## [3.1.1](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.1.0...@readme/stylelint-config@3.1.1) (2022-10-03)
175
+
176
+ **Note:** Version bump only for package @readme/stylelint-config
177
+
178
+ # [3.1.0](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.0.1...@readme/stylelint-config@3.1.0) (2022-08-31)
179
+
180
+ ### Features
181
+
182
+ - **stylelint:** use "simple" selector-not-notation ([#514](https://github.com/readmeio/standards/issues/514)) ([0c83923](https://github.com/readmeio/standards/commit/0c8392345796ad6be41e4f2a862dbbc1c6921e62))
183
+
184
+ ## [3.0.1](https://github.com/readmeio/standards/compare/@readme/stylelint-config@3.0.0...@readme/stylelint-config@3.0.1) (2022-08-29)
185
+
186
+ **Note:** Version bump only for package @readme/stylelint-config
187
+
188
+ # [3.0.0](https://github.com/readmeio/standards/compare/@readme/stylelint-config@2.0.0...@readme/stylelint-config@3.0.0) (2022-08-10)
189
+
190
+ **Note:** Version bump only for package @readme/stylelint-config
191
+
192
+ # [2.0.0](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.14...@readme/stylelint-config@2.0.0) (2022-07-25)
193
+
194
+ ### Features
195
+
196
+ - requiring Node 14.18+ ([c5f5350](https://github.com/readmeio/standards/commit/c5f5350935fc6bed8b5bf27f0c7d92316a6b3cd0))
197
+
198
+ ## [1.1.14](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.13...@readme/stylelint-config@1.1.14) (2022-07-13)
199
+
200
+ **Note:** Version bump only for package @readme/stylelint-config
201
+
202
+ ## [1.1.13](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.12...@readme/stylelint-config@1.1.13) (2022-07-13)
203
+
204
+ ### Bug Fixes
205
+
206
+ - reverting the unicorn eslint plugin as v43 requires >=Node 14.18 ([#455](https://github.com/readmeio/standards/issues/455)) ([334a1b5](https://github.com/readmeio/standards/commit/334a1b58bdf72f4152529f29655d2d6411cb4d76))
207
+
208
+ ## [1.1.12](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.11...@readme/stylelint-config@1.1.12) (2022-07-07)
209
+
210
+ **Note:** Version bump only for package @readme/stylelint-config
211
+
212
+ ## [1.1.11](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.10...@readme/stylelint-config@1.1.11) (2022-06-21)
213
+
214
+ **Note:** Version bump only for package @readme/stylelint-config
215
+
216
+ ## [1.1.10](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.9...@readme/stylelint-config@1.1.10) (2022-06-13)
217
+
218
+ **Note:** Version bump only for package @readme/stylelint-config
219
+
220
+ ## [1.1.9](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.8...@readme/stylelint-config@1.1.9) (2022-05-31)
221
+
222
+ **Note:** Version bump only for package @readme/stylelint-config
223
+
224
+ ## [1.1.8](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.7...@readme/stylelint-config@1.1.8) (2022-05-23)
225
+
226
+ **Note:** Version bump only for package @readme/stylelint-config
227
+
228
+ ## [1.1.7](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.6...@readme/stylelint-config@1.1.7) (2022-04-26)
229
+
230
+ **Note:** Version bump only for package @readme/stylelint-config
231
+
232
+ ## [1.1.6](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.5...@readme/stylelint-config@1.1.6) (2022-04-26)
233
+
234
+ **Note:** Version bump only for package @readme/stylelint-config
235
+
236
+ ## [1.1.5](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.4...@readme/stylelint-config@1.1.5) (2022-04-26)
237
+
238
+ **Note:** Version bump only for package @readme/stylelint-config
239
+
240
+ ## [1.1.4](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.3...@readme/stylelint-config@1.1.4) (2022-04-20)
241
+
242
+ **Note:** Version bump only for package @readme/stylelint-config
243
+
244
+ ## [1.1.3](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.2...@readme/stylelint-config@1.1.3) (2022-04-18)
245
+
246
+ **Note:** Version bump only for package @readme/stylelint-config
247
+
248
+ ## [1.1.2](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.1...@readme/stylelint-config@1.1.2) (2022-04-12)
249
+
250
+ **Note:** Version bump only for package @readme/stylelint-config
251
+
252
+ ## [1.1.1](https://github.com/readmeio/standards/compare/@readme/stylelint-config@1.1.0...@readme/stylelint-config@1.1.1) (2022-04-06)
253
+
254
+ ### Bug Fixes
255
+
256
+ - out of date lockfiles ([318393a](https://github.com/readmeio/standards/commit/318393ac195feda4701da171af08e02a80dedf12))
257
+
258
+ # 1.1.0 (2022-04-04)
259
+
260
+ ### Features
261
+
262
+ - **stylelint-config:** init new config package for stylelint ([#349](https://github.com/readmeio/standards/issues/349)) ([e697176](https://github.com/readmeio/standards/commit/e697176e4b1d95528175e148d5d4acec25e346d4))
@@ -0,0 +1,117 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`stylelint-config with an invalid file and auto-fix enabled matches the auto-fixed snapshot 1`] = `
4
+ "@import "x.css";
5
+ @import "y.css";
6
+
7
+ $one: "one";
8
+ $twoCamelCase: "two";
9
+
10
+ /**
11
+ * Multi-line comment
12
+ */
13
+
14
+ :root {
15
+ --brand-red: hsl(5deg 10% 40%);
16
+ }
17
+
18
+ #id-selector {
19
+ color: blue;
20
+
21
+ #another-id {
22
+ border: 0;
23
+ }
24
+ }
25
+
26
+ #ValidIdSelector {
27
+ padding: 0;
28
+ }
29
+
30
+ #badIdSelector {
31
+ border: 0;
32
+ }
33
+
34
+ .selector-1,
35
+ .selector-2,
36
+ .selector-3[type="text"] {
37
+ background: linear-gradient(#fff, rgb(0 0 0 / 0.8));
38
+ box-sizing: border-box;
39
+ color: var(--brand-red);
40
+ display: block;
41
+ }
42
+
43
+ .selector-a,
44
+ .selector-b:not(:first-child) {
45
+ padding: 10px !important;
46
+ top: calc(100% - 2rem);
47
+ }
48
+
49
+ .selector-x {
50
+ width: 10%;
51
+ }
52
+
53
+ .selector-y {
54
+ width: 20%;
55
+ }
56
+
57
+ .selector-z {
58
+ width: 30%;
59
+ }
60
+
61
+ /* Single-line comment */
62
+
63
+ @media (width >= 60em) {
64
+ .selector {
65
+ /* Flush to parent comment */
66
+ transform: translate(1, 1) scale(3);
67
+ }
68
+ }
69
+
70
+ @media (orientation: portrait), projection and (color) {
71
+ .selector-i + .selector-ii {
72
+ background: hsl(20deg 25% 33%);
73
+ font-family: Helvetica, "Arial Black", sans-serif;
74
+ }
75
+ }
76
+
77
+ /* Flush single line comment */
78
+ @media screen and (min-resolution: 192dpi), screen and (min-resolution: 2dppx) {
79
+ .selector {
80
+ animation: 3s none fade-in;
81
+ background-image: repeating-linear-gradient(
82
+ -45deg,
83
+ transparent,
84
+ #fff 25px,
85
+ rgb(255 255 255 / 1) 50px
86
+ );
87
+ box-shadow: 0 1px 1px #000, 0 1px 0 #fff, 2px 2px 1px 1px #ccc inset;
88
+ height: 10rem;
89
+ margin: 10px;
90
+ margin-bottom: 5px;
91
+ }
92
+
93
+ /* Flush nested single line comment */
94
+ .selector::after {
95
+ background-image: url("x.svg");
96
+ content: "→";
97
+ }
98
+ }
99
+
100
+ @keyframes fade-in {
101
+ from {
102
+ opacity: 0;
103
+ }
104
+
105
+ to {
106
+ opacity: 1;
107
+ }
108
+ }
109
+
110
+ // Prefer "simple" selector-not-notation
111
+ .selector-not-notation {
112
+ &:not(.one):not(.two):not(.three) {
113
+ display: block;
114
+ }
115
+ }
116
+ "
117
+ `;
@@ -0,0 +1,85 @@
1
+ const fs = require('fs');
2
+
3
+ const stylelint = require('stylelint');
4
+
5
+ const config = require('..');
6
+
7
+ const invalidScss = fs.readFileSync('./__tests__/invalid.scss', 'utf-8');
8
+ const validScss = fs.readFileSync('./__tests__/valid.scss', 'utf-8');
9
+
10
+ describe('stylelint-config', () => {
11
+ let data;
12
+ let warnings;
13
+
14
+ describe('with a valid file', () => {
15
+ beforeEach(async () => {
16
+ data = await stylelint.lint({
17
+ code: validScss,
18
+ config,
19
+ });
20
+ ({ warnings } = data.results[0]);
21
+ });
22
+
23
+ it('has no errors', () => {
24
+ expect(data.errored).toBeFalsy();
25
+ });
26
+
27
+ it('flags no warnings', () => {
28
+ expect(warnings).toHaveLength(0);
29
+ });
30
+ });
31
+
32
+ describe('with an invalid file and auto-fix enabled', () => {
33
+ beforeEach(async () => {
34
+ data = await stylelint.lint({
35
+ code: invalidScss,
36
+ config,
37
+ fix: true,
38
+ });
39
+ ({ warnings } = data.results[0]);
40
+ });
41
+
42
+ it('matches the auto-fixed snapshot', () => {
43
+ expect(data.output).toMatchSnapshot();
44
+ });
45
+
46
+ it('has errors', () => {
47
+ expect(data.errored).toBeTruthy();
48
+ });
49
+
50
+ it('flags warnings', () => {
51
+ expect(warnings).toContainEqual(
52
+ expect.objectContaining({
53
+ text: expect.stringMatching(/scss\/dollar-variable-pattern/),
54
+ })
55
+ );
56
+ expect(warnings).toContainEqual(
57
+ expect.objectContaining({
58
+ text: expect.stringMatching(/color-function-notation/),
59
+ })
60
+ );
61
+ expect(warnings).toContainEqual(
62
+ expect.objectContaining({
63
+ text: expect.stringMatching(/selector-id-pattern/),
64
+ })
65
+ );
66
+ expect(warnings).toContainEqual(
67
+ expect.objectContaining({
68
+ text: expect.stringMatching(/selector-max-id/),
69
+ })
70
+ );
71
+ });
72
+
73
+ it('expects no more than 1 id selector', () => {
74
+ expect(warnings.some(w => w.rule === 'selector-max-id')).toBeTruthy();
75
+ });
76
+
77
+ it('expects id pattern to be either kebab-case or TitleCase', () => {
78
+ expect(warnings.some(w => w.rule === 'selector-id-pattern')).toBeTruthy();
79
+ });
80
+
81
+ it('auto-fixes "selector-not-notation" to "simple" pattern', () => {
82
+ expect(data.output).toContain('&:not(.one):not(.two):not(.three)');
83
+ });
84
+ });
85
+ });
@@ -0,0 +1,109 @@
1
+ @import url("x.css");
2
+ @import url("y.css");
3
+
4
+ $one: "one";
5
+ $twoCamelCase: "two";
6
+
7
+ /**
8
+ * Multi-line comment
9
+ */
10
+
11
+ :root {
12
+ --brand-red: hsl(5deg 10% 40%);
13
+ }
14
+
15
+ #id-selector {
16
+ color: blue;
17
+
18
+ #another-id {
19
+ border: 0;
20
+ }
21
+ }
22
+
23
+ #ValidIdSelector {
24
+ padding: 0px 0px 0px;
25
+ }
26
+
27
+ #badIdSelector {
28
+ border: 0;
29
+ }
30
+
31
+ .selector-1,
32
+ .selector-2,
33
+ .selector-3[type="text"] {
34
+ background: linear-gradient(#fff, rgb(0 0 0 / 80%));
35
+ box-sizing: border-box;
36
+ display: block;
37
+ color: var(--brand-red);
38
+ }
39
+
40
+ .selector-a,
41
+ .selector-b:not(:first-child) {
42
+ padding: 10px !important;
43
+ top: calc(100% - 2rem);
44
+ }
45
+
46
+ .selector-x {
47
+ width: 10%;
48
+ }
49
+ .selector-y {
50
+ width: 20%;
51
+ }
52
+ .selector-z {
53
+ width: 30%;
54
+ }
55
+
56
+ /* Single-line comment */
57
+
58
+ @media (width >= 60em) {
59
+ .selector {
60
+ /* Flush to parent comment */
61
+ transform: translate(1, 1) scale(3);
62
+ }
63
+ }
64
+
65
+ @media (orientation: portrait), projection and (color) {
66
+ .selector-i + .selector-ii {
67
+ background: hsl(20deg 25% 33%);
68
+ font-family: Helvetica, "Arial Black", sans-serif;
69
+ }
70
+ }
71
+
72
+ /* Flush single line comment */
73
+ @media screen and (min-resolution: 192dpi), screen and (min-resolution: 2dppx) {
74
+ .selector {
75
+ animation: 3s none fade-in;
76
+ background-image: repeating-linear-gradient(
77
+ -45deg,
78
+ transparent,
79
+ #fff 25px,
80
+ rgb(255 255 255 / 100%) 50px
81
+ );
82
+ margin: 10px;
83
+ margin-bottom: 5px;
84
+ box-shadow: 0 1px 1px #000, 0 1px 0 #fff, 2px 2px 1px 1px #ccc inset;
85
+ height: 10rem;
86
+ }
87
+
88
+ /* Flush nested single line comment */
89
+ .selector::after {
90
+ content: "→";
91
+ background-image: url("x.svg");
92
+ }
93
+ }
94
+
95
+ @keyframes fade-in {
96
+ from {
97
+ opacity: 0;
98
+ }
99
+ to {
100
+ opacity: 1;
101
+ }
102
+ }
103
+
104
+ // Prefer "simple" selector-not-notation
105
+ .selector-not-notation {
106
+ &:not(.one, .two, .three) {
107
+ display: block;
108
+ }
109
+ }
@@ -0,0 +1,109 @@
1
+ @import "x.css";
2
+ @import "y.css";
3
+
4
+ $one: "one";
5
+ $two-kebab-case: "two";
6
+ $media-query-width: 300px;
7
+
8
+ /**
9
+ * Multi-line comment
10
+ */
11
+
12
+ :root {
13
+ --brand-red: rgb(112, 94, 92);
14
+ }
15
+
16
+ #id-selector {
17
+ color: blue;
18
+ }
19
+
20
+ #ValidIdSelector {
21
+ padding: 0;
22
+ }
23
+
24
+ .selector-1,
25
+ .selector-2,
26
+ .selector-3[type="text"] {
27
+ background: linear-gradient(#fff, rgba(0, 0, 0, 0.8));
28
+ box-sizing: border-box;
29
+ color: var(--brand-red);
30
+ display: block;
31
+ }
32
+
33
+ .selector-a,
34
+ .selector-b:not(:first-child) {
35
+ padding: 10px !important;
36
+ top: calc(100% - 2rem);
37
+ }
38
+
39
+ .selector-x {
40
+ width: 10%;
41
+ }
42
+
43
+ .selector-y {
44
+ width: 20%;
45
+ }
46
+
47
+ .selector-z {
48
+ width: 30%;
49
+ }
50
+
51
+ /* Single-line comment */
52
+
53
+ @media (min-width: $media-query-width) {
54
+ border: 1px solid black;
55
+ }
56
+
57
+ @media (width >= 60em) {
58
+ .selector {
59
+ /* Flush to parent comment */
60
+ transform: translate(1, 1) scale(3);
61
+ }
62
+ }
63
+
64
+ @media (orientation: portrait), projection and (color) {
65
+ .selector-i + .selector-ii {
66
+ background: rgb(105, 77, 63);
67
+ font-family: Helvetica, "Arial Black", sans-serif;
68
+ }
69
+ }
70
+
71
+ /* Flush single line comment */
72
+ @media screen and (min-resolution: 192dpi), screen and (min-resolution: 2dppx) {
73
+ .selector {
74
+ animation: 3s none fade-in;
75
+ background-image: repeating-linear-gradient(
76
+ -45deg,
77
+ transparent,
78
+ #fff 25px,
79
+ rgb(255, 255, 255, 1) 50px
80
+ );
81
+ box-shadow: 0 1px 1px #000, 0 1px 0 #fff, 2px 2px 1px 1px #ccc inset;
82
+ height: 10rem;
83
+ margin: 10px;
84
+ margin-bottom: 5px;
85
+ }
86
+
87
+ /* Flush nested single line comment */
88
+ .selector::after {
89
+ background-image: url("x.svg");
90
+ content: "→";
91
+ }
92
+ }
93
+
94
+ @keyframes fade-in {
95
+ from {
96
+ opacity: 0;
97
+ }
98
+
99
+ to {
100
+ opacity: 1;
101
+ }
102
+ }
103
+
104
+ // Prefer "simple" selector-not-notation
105
+ .selector-not-notation {
106
+ &:not(.one):not(.two):not(.three) {
107
+ display: block;
108
+ }
109
+ }
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@readme/stylelint-config",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "ReadMe coding standards for styles",
5
- "main": "index.js",
6
- "files": [
7
- "index.js"
8
- ],
5
+ "main": "src/index.js",
9
6
  "scripts": {
10
7
  "lint": "eslint .",
11
8
  "test": "jest"
@@ -21,20 +18,20 @@
21
18
  },
22
19
  "homepage": "https://github.com/readmeio/standards",
23
20
  "dependencies": {
21
+ "stylelint": "^15.10.0",
24
22
  "stylelint-config-css-modules": "^4.2.0",
25
- "stylelint-config-prettier": "^9.0.5",
26
- "stylelint-config-sass-guidelines": "^9.0.1",
27
- "stylelint-config-standard": "^29.0.0",
28
- "stylelint-config-standard-scss": "^6.1.0",
29
- "stylelint-prettier": "^2.0.0"
23
+ "stylelint-config-sass-guidelines": "^10.0.0",
24
+ "stylelint-config-standard": "^34.0.0",
25
+ "stylelint-config-standard-scss": "^10.0.0",
26
+ "stylelint-order": "^6.0.3",
27
+ "stylelint-prettier": "^3.0.0"
30
28
  },
31
29
  "peerDependencies": {
32
- "postcss": "^8.4.12",
33
- "stylelint": "^14.6.1"
30
+ "postcss": "^8.4.12"
34
31
  },
35
32
  "devDependencies": {
36
- "@readme/eslint-config": "^10.6.1",
33
+ "@readme/eslint-config": "^10.6.2",
37
34
  "jest": "^29.4.3"
38
35
  },
39
- "gitHead": "4b53a9bdf9efd6006033bf34656dc7a3da321d65"
36
+ "gitHead": "c6355d9f0a28ebc9a9e739d9718a91e27d7ed256"
40
37
  }
@@ -13,9 +13,12 @@ module.exports = {
13
13
  'stylelint-config-css-modules',
14
14
 
15
15
  // Enable prettier formatting for SCSS/CSS
16
- 'stylelint-config-prettier',
17
16
  'stylelint-prettier/recommended',
18
17
  ],
18
+ plugins: [
19
+ // Enable ordering rules for content within declaration blocks.
20
+ 'stylelint-order',
21
+ ],
19
22
  rules: {
20
23
  // Until we migrate *all* our repos away from legacy node-sass to dart sass,
21
24
  // we must continue defining alpha values with decimal numbers. Node-sass
@@ -51,6 +54,16 @@ module.exports = {
51
54
  // ReadMe breaks this rule in many places.
52
55
  'max-nesting-depth': null,
53
56
 
57
+ // Prefer neither "prefix" or "context" notations for media queries.
58
+ // e.g. "min-width: 400px" or "width >= 600px"
59
+ // https://stylelint.io/user-guide/rules/media-feature-range-notation/
60
+ 'media-feature-range-notation': null,
61
+
62
+ // Rule is not appropriate when using SCSS variables with media queries.
63
+ // e.g. @media (max-width: $container-lg)
64
+ // https://stylelint.io/user-guide/rules/media-query-no-invalid/
65
+ 'media-query-no-invalid': null,
66
+
54
67
  // Allows us to write duplicate selectors in groups
55
68
  // https://github.com/stylelint/stylelint/issues/3196
56
69
  'no-descending-specificity': [
@@ -107,6 +120,7 @@ module.exports = {
107
120
  'rules',
108
121
  ],
109
122
  ],
123
+ 'order/properties-alphabetical-order': true,
110
124
 
111
125
  // Custom regex of ReadMe's current BEM selector class pattern.
112
126
  'selector-class-pattern': [
@@ -121,7 +135,7 @@ module.exports = {
121
135
  'selector-id-pattern': [
122
136
  '^(([a-z][a-z0-9]*(-[a-z0-9]+)*)|([A-Z][a-z0-9]*)+)$',
123
137
  {
124
- message: 'Expected id selector to be kebab-case or TitleCase',
138
+ message: 'Expected id selector to be kebab-case or TitleCase (selector-id-pattern)',
125
139
  },
126
140
  ],
127
141