Skip to content

Stylelint: Migrate configuration from JSON to JavaScript format #69590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/** @type {import('stylelint').Config} */
module.exports = {
extends: '@wordpress/stylelint-config/scss-stylistic',
rules: {
'at-rule-empty-line-before': null,
'at-rule-no-unknown': null,
'comment-empty-line-before': null,
'declaration-property-value-allowed-list': [
{
'flex-direction': '/^(?!(row|column)-reverse).*$/',
},
{
message:
'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.',
},
],
'declaration-property-value-disallowed-list': [
{
'/.*/': [ '/--wp-components-color-/' ],
},
{
message:
'--wp-components-color-* variables are not ready to be used outside of the components package.',
},
],
'font-weight-notation': null,
'@stylistic/max-line-length': null,
'no-descending-specificity': null,
'property-disallowed-list': [
[ 'order' ],
{
message:
'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.',
},
],
'rule-empty-line-before': null,
'selector-class-pattern': null,
'value-keyword-case': null,
'scss/operator-no-unspaced': null,
'scss/selector-no-redundant-nesting-selector': null,
'scss/load-partial-extension': null,
'scss/no-global-function-names': null,
'scss/comment-no-empty': null,
'scss/at-extend-no-missing-placeholder': null,
'scss/operator-no-newline-after': null,
'scss/at-if-closing-brace-newline-after': null,
'scss/at-else-empty-line-before': null,
'scss/at-if-closing-brace-space-after': null,
'no-invalid-position-at-import-rule': null,
},
reportDescriptionlessDisables: true,
};
48 changes: 0 additions & 48 deletions .stylelintrc.json

This file was deleted.

6 changes: 3 additions & 3 deletions docs/contributors/folder-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The following snippet explains how the Gutenberg repository is structured omitti
├── .eslintignore
├── .prettierrc.js
├── .stylelintignore
├── .stylelintrc.json
├── .stylelintrc.js
├── .markdownlintignore
├── .npmpackagejsonlintrc.json
├── phpcs.xml.dist
Expand Down Expand Up @@ -76,8 +76,8 @@ The following snippet explains how the Gutenberg repository is structured omitti
│ Set of documentation pages composing the [Block editor handbook](https://developer.wordpress.org/block-editor/).
├── platform-docs
│ Documentation website targeted to non WordPress developers
│ using Gutenberg in their own applications.
│ Documentation website targeted to non WordPress developers
│ using Gutenberg in their own applications.
│ Deployed on [https://wordpress.org/gutenberg-framework/](https://wordpress.org/gutenberg-framework/).
Expand Down
2 changes: 1 addition & 1 deletion packages/components/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('stylelint').Config} */
module.exports = {
extends: '../../.stylelintrc.json',
extends: '../../.stylelintrc.js',
rules: {
'declaration-property-value-disallowed-list': [
{
Expand Down
Loading