@aarongoldenthal/stylelint-config-standard 11.0.0 → 11.2.0

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.
Files changed (2) hide show
  1. package/index.js +225 -7
  2. package/package.json +11 -12
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  module.exports = {
4
- extends: ['stylelint-config-standard'],
5
4
  overrides: [
6
5
  {
7
6
  files: ['**/*.html', '**/*.handlebars'],
@@ -15,24 +14,243 @@ module.exports = {
15
14
  reportDescriptionlessDisables: true,
16
15
  reportInvalidScopeDisables: true,
17
16
  reportNeedlessDisables: true,
17
+ // Based on https://www.npmjs.com/package/stylelint-config-standard, with some changes
18
18
  rules: {
19
+ 'alpha-value-notation': [
20
+ 'percentage',
21
+ {
22
+ exceptProperties: [
23
+ 'opacity',
24
+ 'fill-opacity',
25
+ 'flood-opacity',
26
+ 'stop-opacity',
27
+ 'stroke-opacity'
28
+ ]
29
+ }
30
+ ],
19
31
  'annotation-no-unknown': true,
20
- 'color-hex-length': 'long',
32
+ 'at-rule-empty-line-before': [
33
+ 'always',
34
+ {
35
+ // eslint-disable-next-line sonarjs/no-duplicate-string -- enumeration
36
+ except: ['blockless-after-same-name-blockless', 'first-nested'],
37
+ // eslint-disable-next-line sonarjs/no-duplicate-string -- enumeration
38
+ ignore: ['after-comment']
39
+ }
40
+ ],
41
+ 'at-rule-name-case': 'lower',
42
+ // eslint-disable-next-line sonarjs/no-duplicate-string -- enumeration
43
+ 'at-rule-name-space-after': 'always-single-line',
44
+ 'at-rule-no-unknown': true,
45
+ 'at-rule-no-vendor-prefix': true,
46
+ 'at-rule-semicolon-newline-after': 'always',
47
+ 'block-closing-brace-empty-line-before': 'never',
48
+ 'block-closing-brace-newline-after': 'always',
49
+ // eslint-disable-next-line sonarjs/no-duplicate-string -- enumeration
50
+ 'block-closing-brace-newline-before': 'always-multi-line',
51
+ 'block-closing-brace-space-before': 'always-single-line',
52
+ 'block-no-empty': true,
53
+ 'block-opening-brace-newline-after': 'always-multi-line',
54
+ 'block-opening-brace-space-after': 'always-single-line',
55
+ 'block-opening-brace-space-before': 'always',
56
+ 'color-function-notation': 'modern',
57
+ 'color-hex-case': 'lower',
58
+ 'color-hex-length': 'long', // Changed
59
+ 'color-no-invalid-hex': true,
60
+ 'comment-empty-line-before': [
61
+ 'always',
62
+ {
63
+ except: ['first-nested'],
64
+ ignore: ['stylelint-commands']
65
+ }
66
+ ],
67
+ 'comment-no-empty': true,
68
+ 'comment-whitespace-inside': 'always',
69
+ 'custom-property-empty-line-before': [
70
+ 'always',
71
+ {
72
+ except: ['after-custom-property', 'first-nested'],
73
+ ignore: ['after-comment', 'inside-single-line-block']
74
+ }
75
+ ],
76
+ 'custom-property-no-missing-var-function': true,
77
+ 'custom-media-pattern': [
78
+ // eslint-disable-next-line sonarjs/no-duplicate-string -- enumeration
79
+ '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
80
+ {
81
+ message: (name) =>
82
+ `Expected custom media query name "${name}" to be kebab-case`
83
+ }
84
+ ],
85
+ 'custom-property-pattern': [
86
+ '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
87
+ {
88
+ message: (name) =>
89
+ `Expected custom property name "${name}" to be kebab-case`
90
+ }
91
+ ],
92
+ 'declaration-bang-space-after': 'never',
93
+ 'declaration-bang-space-before': 'always',
94
+ 'declaration-block-no-duplicate-custom-properties': true,
95
+ 'declaration-block-no-duplicate-properties': [
96
+ true,
97
+ {
98
+ ignore: ['consecutive-duplicates-with-different-values']
99
+ }
100
+ ],
101
+ 'declaration-block-no-shorthand-property-overrides': true,
102
+ 'declaration-block-semicolon-newline-after': 'always-multi-line',
103
+ 'declaration-block-semicolon-space-after': 'always-single-line',
104
+ 'declaration-block-semicolon-space-before': 'never',
105
+ 'declaration-block-single-line-max-declarations': 1,
106
+ 'declaration-block-trailing-semicolon': 'always',
107
+ 'declaration-block-no-redundant-longhand-properties': true,
108
+ 'declaration-colon-newline-after': 'always-multi-line',
109
+ 'declaration-colon-space-after': 'always-single-line',
110
+ 'declaration-colon-space-before': 'never',
111
+ 'declaration-empty-line-before': [
112
+ 'always',
113
+ {
114
+ except: ['after-declaration', 'first-nested'],
115
+ ignore: ['after-comment', 'inside-single-line-block']
116
+ }
117
+ ],
21
118
  'font-family-name-quotes': 'always-where-recommended',
119
+ 'font-family-no-duplicate-names': true,
120
+ 'font-family-no-missing-generic-family-keyword': true,
121
+ 'function-calc-no-unspaced-operator': true,
122
+ 'function-comma-newline-after': 'always-multi-line',
123
+ 'function-comma-space-after': 'always-single-line',
124
+ 'function-comma-space-before': 'never',
125
+ 'function-linear-gradient-no-nonstandard-direction': true,
126
+ 'function-max-empty-lines': 0,
127
+ 'function-name-case': 'lower',
128
+ 'function-no-unknown': true,
129
+ 'function-parentheses-newline-inside': 'always-multi-line',
130
+ 'function-parentheses-space-inside': 'never-single-line',
131
+ 'function-url-quotes': 'always',
132
+ 'function-whitespace-after': 'always',
133
+ 'hue-degree-notation': 'angle',
134
+ 'import-notation': 'url',
135
+ indentation: 2,
22
136
  'keyframe-block-no-duplicate-selectors': true,
23
- 'keyframe-selector-notation': 'percentage',
137
+ 'keyframe-declaration-no-important': true,
138
+ 'keyframe-selector-notation': 'percentage', // Changed
139
+ 'keyframes-name-pattern': [
140
+ '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
141
+ {
142
+ message: (name) =>
143
+ `Expected keyframe name "${name}" to be kebab-case`
144
+ }
145
+ ],
146
+ 'length-zero-no-unit': true,
147
+ 'max-empty-lines': 1,
148
+ 'max-line-length': 120,
149
+ 'media-feature-colon-space-after': 'always',
150
+ 'media-feature-colon-space-before': 'never',
151
+ 'media-feature-name-case': 'lower',
152
+ 'media-feature-name-no-unknown': true,
153
+ 'media-feature-name-no-vendor-prefix': true,
154
+ 'media-feature-parentheses-space-inside': 'never',
155
+ 'media-feature-range-operator-space-after': 'always',
156
+ 'media-feature-range-operator-space-before': 'always',
157
+ 'media-query-list-comma-newline-after': 'always-multi-line',
158
+ 'media-query-list-comma-space-after': 'always-single-line',
159
+ 'media-query-list-comma-space-before': 'never',
160
+ 'named-grid-areas-no-invalid': true,
161
+ 'no-descending-specificity': true,
162
+ 'no-duplicate-at-import-rules': true,
163
+ 'no-duplicate-selectors': true,
164
+ 'no-empty-first-line': true,
165
+ 'no-empty-source': true,
166
+ 'no-eol-whitespace': true,
167
+ 'no-extra-semicolons': true,
168
+ 'no-invalid-double-slash-comments': true,
169
+ 'no-invalid-position-at-import-rule': true,
170
+ 'no-irregular-whitespace': true,
171
+ 'no-missing-end-of-source-newline': true,
172
+ 'number-leading-zero': 'always',
173
+ 'number-max-precision': 4,
174
+ 'number-no-trailing-zeros': true,
175
+ 'property-case': 'lower',
176
+ 'property-no-unknown': true,
177
+ 'property-no-vendor-prefix': true,
178
+ 'rule-empty-line-before': [
179
+ 'always-multi-line',
180
+ {
181
+ except: ['first-nested'],
182
+ ignore: ['after-comment']
183
+ }
184
+ ],
185
+ 'selector-attribute-brackets-space-inside': 'never',
186
+ 'selector-attribute-operator-space-after': 'never',
187
+ 'selector-attribute-operator-space-before': 'never',
188
+ 'selector-attribute-quotes': 'always',
189
+ 'selector-class-pattern': [
190
+ '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
191
+ {
192
+ message: (selector) =>
193
+ `Expected class selector "${selector}" to be kebab-case`
194
+ }
195
+ ],
196
+ 'selector-combinator-space-after': 'always',
197
+ 'selector-combinator-space-before': 'always',
198
+ 'selector-descendant-combinator-no-non-space': true,
199
+ 'selector-id-pattern': [
200
+ '^([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
201
+ {
202
+ message: (selector) =>
203
+ `Expected id selector "${selector}" to be kebab-case`
204
+ }
205
+ ],
206
+ 'selector-list-comma-newline-after': 'always',
207
+ 'selector-list-comma-space-before': 'never',
208
+ 'selector-max-empty-lines': 0,
209
+ 'selector-no-vendor-prefix': true,
24
210
  'selector-not-notation': 'complex',
211
+ 'selector-pseudo-class-case': 'lower',
212
+ 'selector-pseudo-class-no-unknown': true,
213
+ 'selector-pseudo-class-parentheses-space-inside': 'never',
214
+ 'selector-pseudo-element-case': 'lower',
215
+ 'selector-pseudo-element-colon-notation': 'double',
216
+ 'selector-pseudo-element-no-unknown': true,
217
+ 'selector-type-case': 'lower',
218
+ 'selector-type-no-unknown': [
219
+ true,
220
+ {
221
+ ignore: ['custom-elements']
222
+ }
223
+ ],
224
+ 'shorthand-property-no-redundant-values': true,
225
+ 'string-no-newline': true,
226
+ 'string-quotes': 'double',
25
227
  'unit-allowed-list': [
228
+ // Changed
26
229
  '%',
230
+ `ch`,
231
+ 'deg',
27
232
  'em',
28
233
  'fr',
234
+ 'ms',
235
+ 'px',
29
236
  'rem',
30
237
  's',
31
- 'px',
32
238
  'vh',
33
- 's',
34
- 'ms',
35
- 'deg'
239
+ `vw`
240
+ ],
241
+ 'unit-case': 'lower',
242
+ 'unit-no-unknown': true,
243
+ 'value-keyword-case': 'lower',
244
+ 'value-list-comma-newline-after': 'always-multi-line',
245
+ 'value-list-comma-space-after': 'always-single-line',
246
+ 'value-list-comma-space-before': 'never',
247
+ 'value-list-max-empty-lines': 0,
248
+ 'value-no-vendor-prefix': [
249
+ true,
250
+ {
251
+ // `-webkit-box` is allowed as standard. See https://www.w3.org/TR/css-overflow-3/#webkit-line-clamp
252
+ ignoreValues: ['box']
253
+ }
36
254
  ],
37
255
  'csstree/validator': true,
38
256
  'order/properties-alphabetical-order': true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aarongoldenthal/stylelint-config-standard",
3
- "version": "11.0.0",
3
+ "version": "11.2.0",
4
4
  "description": "Standard StyleLint configuration settings",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://gitlab.com/gitlab-ci-utils/stylelint-config-standard.git"
19
+ "url": "git+https://gitlab.com/gitlab-ci-utils/node/stylelint-config-standard.git"
20
20
  },
21
21
  "keywords": [
22
22
  "stylelint"
@@ -30,26 +30,25 @@
30
30
  "index.js"
31
31
  ],
32
32
  "bugs": {
33
- "url": "https://gitlab.com/gitlab-ci-utils/stylelint-config-standard/issues"
33
+ "url": "https://gitlab.com/gitlab-ci-utils/node/stylelint-config-standard/issues"
34
34
  },
35
- "homepage": "https://gitlab.com/gitlab-ci-utils/stylelint-config-standard",
35
+ "homepage": "https://gitlab.com/gitlab-ci-utils/node/stylelint-config-standard",
36
36
  "dependencies": {
37
37
  "postcss-html": "^1.5.0",
38
38
  "stylelint-config-prettier": "^9.0.3",
39
- "stylelint-config-standard": "^27.0.0",
40
39
  "stylelint-csstree-validator": "^2.0.0",
41
40
  "stylelint-order": "^5.0.0"
42
41
  },
43
42
  "devDependencies": {
44
- "@aarongoldenthal/eslint-config-standard": "^15.0.0",
45
- "eslint": "^8.22.0",
46
- "jest": "^28.1.3",
47
- "jest-junit": "^14.0.0",
48
- "markdownlint-cli": "^0.32.1",
43
+ "@aarongoldenthal/eslint-config-standard": "^17.0.1",
44
+ "eslint": "^8.26.0",
45
+ "jest": "^29.2.1",
46
+ "jest-junit": "^14.0.1",
47
+ "markdownlint-cli": "^0.32.2",
49
48
  "prettier": "^2.7.1",
50
- "stylelint": "^14.10.0"
49
+ "stylelint": "^14.14.0"
51
50
  },
52
51
  "peerDependencies": {
53
- "stylelint": "^14.8.0"
52
+ "stylelint": "^14.11.0"
54
53
  }
55
54
  }