Skip to content

Commit

Permalink
build: update major versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert committed Feb 15, 2024
1 parent 81d1b1f commit 624ddaa
Show file tree
Hide file tree
Showing 4 changed files with 500 additions and 1,790 deletions.
98 changes: 98 additions & 0 deletions .stylelint-wordpress.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/** @type {import('stylelint').Config} */
import wordpressConfig from '@wordpress/stylelint-config';

/**
* WordPress @wordpress/[email protected] is designer for stylelint@14, but we want use stylelint@16
* Many code formatting related rules were removed from stylelint 15, we need to remove those from the config.
* @see https://stylelint.io/migration-guide/to-15/
*/

const deprecatedRules = [
'at-rule-name-case',
'at-rule-name-newline-after',
'at-rule-name-space-after',
'at-rule-semicolon-newline-after',
'at-rule-semicolon-space-before',
'block-closing-brace-empty-line-before',
'block-closing-brace-newline-after',
'block-closing-brace-newline-before',
'block-closing-brace-space-after',
'block-closing-brace-space-before',
'block-opening-brace-newline-after',
'block-opening-brace-newline-before',
'block-opening-brace-space-after',
'block-opening-brace-space-before',
'color-hex-case',
'declaration-bang-space-after',
'declaration-bang-space-before',
'declaration-block-semicolon-newline-after',
'declaration-block-semicolon-newline-before',
'declaration-block-semicolon-space-after',
'declaration-block-semicolon-space-before',
'declaration-block-trailing-semicolon',
'declaration-colon-newline-after',
'declaration-colon-space-after',
'declaration-colon-space-before',
'function-comma-newline-after',
'function-comma-newline-before',
'function-comma-space-after',
'function-comma-space-before',
'function-max-empty-lines',
'function-parentheses-newline-inside',
'function-parentheses-space-inside',
'function-whitespace-after',
'indentation',
'linebreaks',
'max-empty-lines',
'max-line-length',
'media-feature-colon-space-after',
'media-feature-colon-space-before',
'media-feature-name-case',
'media-feature-parentheses-space-inside',
'media-feature-range-operator-space-after',
'media-feature-range-operator-space-before',
'media-query-list-comma-newline-after',
'media-query-list-comma-newline-before',
'media-query-list-comma-space-after',
'media-query-list-comma-space-before',
'no-empty-first-line',
'no-eol-whitespace',
'no-extra-semicolons',
'no-missing-end-of-source-newline',
'number-leading-zero',
'number-no-trailing-zeros',
'property-case',
'selector-attribute-brackets-space-inside',
'selector-attribute-operator-space-after',
'selector-attribute-operator-space-before',
'selector-combinator-space-after',
'selector-combinator-space-before',
'selector-descendant-combinator-no-non-space',
'selector-list-comma-newline-after',
'selector-list-comma-newline-before',
'selector-list-comma-space-after',
'selector-list-comma-space-before',
'selector-max-empty-lines',
'selector-pseudo-class-case',
'selector-pseudo-class-parentheses-space-inside',
'selector-pseudo-element-case',
'string-quotes',
'unicode-bom',
'unit-case',
'value-list-comma-newline-after',
'value-list-comma-newline-before',
'value-list-comma-space-after',
'value-list-comma-space-before',
'value-list-max-empty-lines',
];

const modernConfig = {
// ...wordpressConfig,
rules: Object.fromEntries(
Object.entries(wordpressConfig.rules).filter(
([key, value]) => !deprecatedRules.includes(key)
)
),
};

export default modernConfig;
98 changes: 12 additions & 86 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
{
"extends": [
"@wordpress/stylelint-config",
"stylelint-config-standard-scss"
],
"extends": ["./.stylelint-wordpress.mjs", "stylelint-config-standard-scss"],
"rules": {
"at-rule-name-space-after": null,
"declaration-bang-space-after": null,
"declaration-bang-space-before": null,
"function-whitespace-after": null,
"media-feature-colon-space-after": null,
"media-feature-colon-space-before": null,
"media-feature-range-operator-space-after": null,
"media-feature-range-operator-space-before": null,
"selector-attribute-brackets-space-inside": null,
"selector-attribute-operator-space-after": null,
"selector-attribute-operator-space-before": null,
"selector-pseudo-class-parentheses-space-inside": null,
"scss/at-mixin-pattern": "^[a-z][a-z0-9-_]*$",
"scss/at-rule-no-unknown": true,
"scss/dollar-variable-default": true,
"scss/dollar-variable-first-in-block": [
true,
{ "ignore": ["comments", "imports"] }
],
"scss/dollar-variable-pattern": "^(denhaag|example|ncb|nl|utrecht)-[a-z0-9-]+$",
"scss/percent-placeholder-pattern": "^(denhaag|example|ncb|nl|utrecht)-[a-z0-9-]+$",
"scss/dollar-variable-pattern": "^(denhaag|example|ncb|nl|utrecht|wp)-[a-z0-9-]+$",
"scss/percent-placeholder-pattern": "^(denhaag|example|ncb|nl|utrecht|wp)-[a-z0-9-]+$",
"scss/operator-no-newline-after": null,
"scss/at-extend-no-missing-placeholder": null,
"custom-property-pattern": "^_?(denhaag|example|ncb|nl|utrecht)-[a-z0-9-]+$",
"selector-class-pattern": null,
"keyframes-name-pattern": "^(denhaag|example|ncb|nl|utrecht)-[a-z0-9-]+$",
"custom-property-pattern": "^_?(denhaag|example|ncb|nl|utrecht|wp)-[a-z0-9-]+$",
"selector-class-pattern": [
"^(denhaag|example|ncb|nl|utrecht|wp)-[a-z0-9_-]+$",
{ "severity": "warning" }
],
"keyframes-name-pattern": "^(denhaag|example|ncb|nl|utrecht|wp)-[a-z0-9-]+$",
"at-rule-no-unknown": null,
"block-no-empty": [true],
"color-no-invalid-hex": [true],
Expand All @@ -49,7 +37,6 @@
"no-duplicate-at-import-rules": [true],
"no-duplicate-selectors": [true],
"no-empty-source": [true],
"no-extra-semicolons": null,
"no-invalid-double-slash-comments": [true],
"property-no-unknown": [true],
"selector-pseudo-class-no-unknown": [true],
Expand All @@ -75,8 +62,6 @@
"unit-disallowed-list": [["s"]],
"font-family-name-quotes": ["always-unless-keyword"],
"function-url-quotes": ["always"],
"number-leading-zero": null,
"number-no-trailing-zeros": null,
"declaration-property-value-disallowed-list": [
{
"text-align": ["left", "right"]
Expand Down Expand Up @@ -137,70 +122,11 @@
]
],
"selector-max-id": [0],
"indentation": null,
"linebreaks": null,
"max-line-length": null,
"function-comma-newline-after": null,
"function-comma-newline-before": null,
"function-comma-space-after": null,
"function-comma-space-before": null,
"function-max-empty-lines": null,
"function-parentheses-newline-inside": null,
"function-parentheses-space-inside": null,
"value-list-comma-newline-after": null,
"value-list-comma-newline-before": null,
"value-list-comma-space-after": null,
"value-list-comma-space-before": null,
"value-list-max-empty-lines": null,
"declaration-colon-newline-after": null,
"declaration-colon-space-after": null,
"declaration-colon-space-before": null,
"declaration-block-semicolon-newline-after": null,
"declaration-block-semicolon-newline-before": null,
"declaration-block-semicolon-space-after": null,
"declaration-block-semicolon-space-before": null,
"declaration-block-trailing-semicolon": null,
"block-closing-brace-empty-line-before": null,
"block-closing-brace-newline-after": null,
"block-closing-brace-newline-before": null,
"block-closing-brace-space-after": null,
"block-closing-brace-space-before": null,
"block-opening-brace-newline-after": null,
"block-opening-brace-newline-before": null,
"block-opening-brace-space-after": null,
"block-opening-brace-space-before": null,
"selector-attribute-quotes": ["always"],
"selector-combinator-space-after": null,
"selector-combinator-space-before": null,
"selector-descendant-combinator-no-non-space": null,
"selector-list-comma-newline-after": null,
"selector-list-comma-newline-before": null,
"selector-list-comma-space-after": null,
"selector-list-comma-space-before": null,
"media-query-list-comma-newline-after": null,
"media-query-list-comma-newline-before": null,
"media-query-list-comma-space-after": null,
"media-query-list-comma-space-before": null,
"value-keyword-case": ["lower", { "camelCaseSvgKeywords": true }],
"declaration-block-no-redundant-longhand-properties": null,
"at-rule-empty-line-before": null,
"at-rule-name-newline-after": null,
"at-rule-semicolon-newline-after": null,
"max-empty-lines": null,
"no-eol-whitespace": null,
"no-missing-end-of-source-newline": null,
"no-empty-first-line": null,
"unicode-bom": null,
"rule-empty-line-before": null,
"color-hex-case": null,
"unit-case": null,
"property-case": null,
"selector-pseudo-class-case": null,
"selector-pseudo-element-case": null,
"selector-max-empty-lines": null,
"media-feature-name-case": null,
"at-rule-name-case": null,
"string-quotes": null,
"property-no-vendor-prefix": null,
"value-keyword-case": ["lower", { "camelCaseSvgKeywords": true }],
"declaration-block-no-redundant-longhand-properties": null
"property-no-vendor-prefix": null
}
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"update-major": "npm-check-updates --configFileName .ncurc.major.cjs --deep --dep dev,prod --target latest --upgrade && pnpm install"
},
"devDependencies": {
"@wordpress/eslint-plugin": "14.12.0",
"@wordpress/prettier-config": "2.25.13",
"@wordpress/scripts": "26.19.0",
"@wordpress/eslint-plugin": "17.7.0",
"@wordpress/prettier-config": "3.7.0",
"@wordpress/scripts": "27.1.0",
"@wordpress/stylelint-config": "21.33.0",
"eslint": "8.56.0",
"eslint-plugin-json": "3.1.0",
Expand All @@ -69,8 +69,8 @@
"npm-run-all": "4.1.5",
"path": "0.12.7",
"resolve-url-loader": "5.0.0",
"stylelint": "14.16.1",
"stylelint-config-standard-scss": "6.1.0",
"stylelint": "16.2.1",
"stylelint-config-standard-scss": "13.0.0",
"wp-prettier": "3.0.3"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 624ddaa

Please sign in to comment.