From f49efa4c3fc8f3d1c5b701800ec55dd53e2be72c Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 24 Mar 2024 02:32:00 +0100 Subject: [PATCH 1/3] Enable a few stylelint rules --- .stylelintrc.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml index c7725159f10a..60cce7dbf75e 100644 --- a/.stylelintrc.yaml +++ b/.stylelintrc.yaml @@ -30,7 +30,7 @@ rules: "@stylistic/block-opening-brace-newline-after": null "@stylistic/block-opening-brace-newline-before": null "@stylistic/block-opening-brace-space-after": null - "@stylistic/block-opening-brace-space-before": null + "@stylistic/block-opening-brace-space-before": always "@stylistic/color-hex-case": lower "@stylistic/declaration-bang-space-after": never "@stylistic/declaration-bang-space-before": null @@ -140,7 +140,7 @@ rules: function-disallowed-list: null function-linear-gradient-no-nonstandard-direction: true function-name-case: lower - function-no-unknown: null + function-no-unknown: true function-url-no-scheme-relative: null function-url-quotes: always function-url-scheme-allowed-list: null @@ -168,7 +168,7 @@ rules: no-duplicate-selectors: true no-empty-source: true no-invalid-double-slash-comments: true - no-invalid-position-at-import-rule: null + no-invalid-position-at-import-rule: [true, ignoreAtRules: [tailwind]] no-irregular-whitespace: true no-unknown-animations: null no-unknown-custom-properties: null @@ -181,6 +181,7 @@ rules: rule-empty-line-before: null rule-selector-property-disallowed-list: null scale-unlimited/declaration-strict-value: [[/color$/, font-weight], {ignoreValues: /^(inherit|transparent|unset|initial|currentcolor|none)$/, ignoreFunctions: false, disableFix: true, expandShorthand: true}] + selector-anb-no-unmatchable: true selector-attribute-name-disallowed-list: null selector-attribute-operator-allowed-list: null selector-attribute-operator-disallowed-list: null From 2ca83e7446932669e2d66c68e22db055f75c81d7 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 24 Mar 2024 02:45:21 +0100 Subject: [PATCH 2/3] add stylelint-value-no-unknown-custom-properties --- .stylelintrc.yaml | 2 ++ package-lock.json | 17 +++++++++++++++++ package.json | 1 + 3 files changed, 20 insertions(+) diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml index 60cce7dbf75e..df1738ff8d0f 100644 --- a/.stylelintrc.yaml +++ b/.stylelintrc.yaml @@ -1,6 +1,7 @@ plugins: - stylelint-declaration-strict-value - stylelint-declaration-block-no-ignored-properties + - stylelint-value-no-unknown-custom-properties - "@stylistic/stylelint-plugin" ignoreFiles: @@ -114,6 +115,7 @@ rules: comment-pattern: null comment-whitespace-inside: null comment-word-disallowed-list: null + csstools/value-no-unknown-custom-properties: [true, importFrom: [web_src/css/base.css, web_src/css/themes/theme-gitea-light.css, web_src/css/themes/theme-gitea-dark.css]] custom-media-pattern: null custom-property-empty-line-before: null custom-property-no-missing-var-function: true diff --git a/package-lock.json b/package-lock.json index ef1164cac3de..8e506df96640 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,6 +91,7 @@ "stylelint": "16.2.1", "stylelint-declaration-block-no-ignored-properties": "2.8.0", "stylelint-declaration-strict-value": "1.10.4", + "stylelint-value-no-unknown-custom-properties": "6.0.1", "svgo": "3.2.0", "updates": "15.3.1", "vite-string-plugin": "1.1.5", @@ -10855,6 +10856,22 @@ "stylelint": ">=7 <=16" } }, + "node_modules/stylelint-value-no-unknown-custom-properties": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/stylelint-value-no-unknown-custom-properties/-/stylelint-value-no-unknown-custom-properties-6.0.1.tgz", + "integrity": "sha512-N60PTdaTknB35j6D4FhW0GL2LlBRV++bRpXMMldWMQZ240yFQaoltzlLY4lXXs7Z0J5mNUYZQ/gjyVtU2DhCMA==", + "dev": true, + "dependencies": { + "postcss-value-parser": "^4.2.0", + "resolve": "^1.22.8" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "stylelint": ">=16" + } + }, "node_modules/stylelint/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", diff --git a/package.json b/package.json index ced10f9c997c..69ca8634aa49 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "stylelint": "16.2.1", "stylelint-declaration-block-no-ignored-properties": "2.8.0", "stylelint-declaration-strict-value": "1.10.4", + "stylelint-value-no-unknown-custom-properties": "6.0.1", "svgo": "3.2.0", "updates": "15.3.1", "vite-string-plugin": "1.1.5", From 1263baa20f83e0b85cb59f245d26243a6b2b4e11 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 24 Mar 2024 02:49:14 +0100 Subject: [PATCH 3/3] Revert "add stylelint-value-no-unknown-custom-properties" This reverts commit 2ca83e7446932669e2d66c68e22db055f75c81d7. --- .stylelintrc.yaml | 2 -- package-lock.json | 17 ----------------- package.json | 1 - 3 files changed, 20 deletions(-) diff --git a/.stylelintrc.yaml b/.stylelintrc.yaml index df1738ff8d0f..60cce7dbf75e 100644 --- a/.stylelintrc.yaml +++ b/.stylelintrc.yaml @@ -1,7 +1,6 @@ plugins: - stylelint-declaration-strict-value - stylelint-declaration-block-no-ignored-properties - - stylelint-value-no-unknown-custom-properties - "@stylistic/stylelint-plugin" ignoreFiles: @@ -115,7 +114,6 @@ rules: comment-pattern: null comment-whitespace-inside: null comment-word-disallowed-list: null - csstools/value-no-unknown-custom-properties: [true, importFrom: [web_src/css/base.css, web_src/css/themes/theme-gitea-light.css, web_src/css/themes/theme-gitea-dark.css]] custom-media-pattern: null custom-property-empty-line-before: null custom-property-no-missing-var-function: true diff --git a/package-lock.json b/package-lock.json index 8e506df96640..ef1164cac3de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -91,7 +91,6 @@ "stylelint": "16.2.1", "stylelint-declaration-block-no-ignored-properties": "2.8.0", "stylelint-declaration-strict-value": "1.10.4", - "stylelint-value-no-unknown-custom-properties": "6.0.1", "svgo": "3.2.0", "updates": "15.3.1", "vite-string-plugin": "1.1.5", @@ -10856,22 +10855,6 @@ "stylelint": ">=7 <=16" } }, - "node_modules/stylelint-value-no-unknown-custom-properties": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/stylelint-value-no-unknown-custom-properties/-/stylelint-value-no-unknown-custom-properties-6.0.1.tgz", - "integrity": "sha512-N60PTdaTknB35j6D4FhW0GL2LlBRV++bRpXMMldWMQZ240yFQaoltzlLY4lXXs7Z0J5mNUYZQ/gjyVtU2DhCMA==", - "dev": true, - "dependencies": { - "postcss-value-parser": "^4.2.0", - "resolve": "^1.22.8" - }, - "engines": { - "node": ">=18.12.0" - }, - "peerDependencies": { - "stylelint": ">=16" - } - }, "node_modules/stylelint/node_modules/ansi-regex": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", diff --git a/package.json b/package.json index 69ca8634aa49..ced10f9c997c 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,6 @@ "stylelint": "16.2.1", "stylelint-declaration-block-no-ignored-properties": "2.8.0", "stylelint-declaration-strict-value": "1.10.4", - "stylelint-value-no-unknown-custom-properties": "6.0.1", "svgo": "3.2.0", "updates": "15.3.1", "vite-string-plugin": "1.1.5",