Skip to content

Commit 3d0dae3

Browse files
im3dabasiaim3dabasiat-hamanoafercia
authored
Stylelint: Migrate configuration from JSON to JavaScript format (#69590)
* feat: Convert stylelint file to .js * fix: Correct folder structure in docs * chore: Add changelog entry * chore: Remove changelog entry * chore: Remove changelog entry Co-authored-by: im3dabasia <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: afercia <[email protected]>
1 parent adc77d7 commit 3d0dae3

File tree

4 files changed

+56
-52
lines changed

4 files changed

+56
-52
lines changed

.stylelintrc.js

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/** @type {import('stylelint').Config} */
2+
module.exports = {
3+
extends: '@wordpress/stylelint-config/scss-stylistic',
4+
rules: {
5+
'at-rule-empty-line-before': null,
6+
'at-rule-no-unknown': null,
7+
'comment-empty-line-before': null,
8+
'declaration-property-value-allowed-list': [
9+
{
10+
'flex-direction': '/^(?!(row|column)-reverse).*$/',
11+
},
12+
{
13+
message:
14+
'Avoid the flex-direction reverse values. For accessibility reasons, visual, reading, and DOM order must match. Only use the reverse values when they do not affect reading order, meaning, and interaction.',
15+
},
16+
],
17+
'declaration-property-value-disallowed-list': [
18+
{
19+
'/.*/': [ '/--wp-components-color-/' ],
20+
},
21+
{
22+
message:
23+
'--wp-components-color-* variables are not ready to be used outside of the components package.',
24+
},
25+
],
26+
'font-weight-notation': null,
27+
'@stylistic/max-line-length': null,
28+
'no-descending-specificity': null,
29+
'property-disallowed-list': [
30+
[ 'order' ],
31+
{
32+
message:
33+
'Avoid the order property. For accessibility reasons, visual, reading, and DOM order must match. Only use the order property when it does not affect reading order, meaning, and interaction.',
34+
},
35+
],
36+
'rule-empty-line-before': null,
37+
'selector-class-pattern': null,
38+
'value-keyword-case': null,
39+
'scss/operator-no-unspaced': null,
40+
'scss/selector-no-redundant-nesting-selector': null,
41+
'scss/load-partial-extension': null,
42+
'scss/no-global-function-names': null,
43+
'scss/comment-no-empty': null,
44+
'scss/at-extend-no-missing-placeholder': null,
45+
'scss/operator-no-newline-after': null,
46+
'scss/at-if-closing-brace-newline-after': null,
47+
'scss/at-else-empty-line-before': null,
48+
'scss/at-if-closing-brace-space-after': null,
49+
'no-invalid-position-at-import-rule': null,
50+
},
51+
reportDescriptionlessDisables: true,
52+
};

.stylelintrc.json

-48
This file was deleted.

docs/contributors/folder-structure.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The following snippet explains how the Gutenberg repository is structured omitti
1515
├── .eslintignore
1616
├── .prettierrc.js
1717
├── .stylelintignore
18-
├── .stylelintrc.json
18+
├── .stylelintrc.js
1919
├── .markdownlintignore
2020
├── .npmpackagejsonlintrc.json
2121
├── phpcs.xml.dist
@@ -76,8 +76,8 @@ The following snippet explains how the Gutenberg repository is structured omitti
7676
│ Set of documentation pages composing the [Block editor handbook](https://developer.wordpress.org/block-editor/).
7777
7878
├── platform-docs
79-
│ Documentation website targeted to non WordPress developers
80-
│ using Gutenberg in their own applications.
79+
│ Documentation website targeted to non WordPress developers
80+
│ using Gutenberg in their own applications.
8181
│ Deployed on [https://wordpress.org/gutenberg-framework/](https://wordpress.org/gutenberg-framework/).
8282
8383

packages/components/.stylelintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @type {import('stylelint').Config} */
22
module.exports = {
3-
extends: '../../.stylelintrc.json',
3+
extends: '../../.stylelintrc.js',
44
rules: {
55
'declaration-property-value-disallowed-list': [
66
{

0 commit comments

Comments
 (0)