From 5d86215f5f0c10013e7a115480578111b0a8100e Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Fri, 2 May 2025 12:39:22 +0900 Subject: [PATCH 01/10] =?UTF-8?q?#490=20[Stylelint]=20disallowed-list?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=82=92=E7=94=A8=E6=84=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update: 既存のunit-disallowed-listにメッセージを付ける --- packages/@d-zero/stylelint-config/values.js | 55 ++++++++++++++++----- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index 80f1602d..6cea1cc7 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -33,19 +33,48 @@ module.exports = { 'flex-shrink': ['0', '1'], }, 'unit-disallowed-list': [ - 'ex', - 'ch', - 'mm', - 'q', - 'cm', - 'in', - 'pt', - 'pc', - 'vm', - 's', - 'grad', - 'rad', - 'turn', + [ + 'ex', + 'ch', + 'mm', + 'q', + 'cm', + 'in', + 'pt', + 'pc', + 'vm', + 's', + 'grad', + 'rad', + 'turn', + 'vw', + 'vh', + 'vi', + 'vb', + 'vmin', + 'vmax', + ], + { + message: (unit) => { + const recommendationMap = { + ex: 'rem', + ch: 'rem', + mm: 'rem', + q: 'rem', + cm: 'rem', + in: 'rem', + pt: 'rem', + pc: 'rem', + vm: 'rem', + s: 'ms', + grad: 'deg', + rad: 'deg', + turn: 'deg', + }; + return `\`${unit}\`は使用しないでください。代わりに\`${recommendationMap[unit]}\`を検討してください。`; + }, + severity: 'warning', + }, ], 'value-keyword-case': [ 'lower', From 9bd990f3e3d07cf0b49010f3311b0496f8cc990b Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Fri, 2 May 2025 12:40:47 +0900 Subject: [PATCH 02/10] =?UTF-8?q?#490=20[Stylelint]=20disallowed-list?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=82=92=E7=94=A8=E6=84=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Feat: `v-`の使用を禁止し、`sv-`, `dv-`, `lv-` を利用するように強制する --- packages/@d-zero/stylelint-config/values.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index 6cea1cc7..0ddc9364 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -70,6 +70,12 @@ module.exports = { grad: 'deg', rad: 'deg', turn: 'deg', + vw: 'svw, dvw, lvw', + vh: 'svh, dvh, lvh', + vi: 'svi, dvi, lvi', + vb: 'svb, dvb, lvb', + vmin: 'svmin, dvmin, lvmin', + vmax: 'svmax, dvmax, lvmax', }; return `\`${unit}\`は使用しないでください。代わりに\`${recommendationMap[unit]}\`を検討してください。`; }, From d4d2705c94e85e10cc59e736d8e1b28fb8634930 Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Fri, 2 May 2025 12:43:49 +0900 Subject: [PATCH 03/10] =?UTF-8?q?#490=20[Stylelint]=20disallowed-list?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=82=92=E7=94=A8=E6=84=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update: 既存のdeclaration-property-value-disallowed-listにメッセージを付ける --- packages/@d-zero/stylelint-config/values.js | 25 ++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index 0ddc9364..82349022 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -8,11 +8,26 @@ const PERCENTATE_UNITS = `(?:%|${VIEWPORT_PERCENTAGE_LENGTHS})`; module.exports = { plugins: ['@d-zero/stylelint-rules'], rules: { - 'declaration-property-value-disallowed-list': { - '/^(?:color|background|background-color|border|border-color|outline|outline-color)$/': - [/#[0-9a-f]{3}/, /(?:rgb|hsl)a?\(.+?\)/], - content: [/^"\\[0-9a-f]{1,6}"$/i], - }, + 'declaration-property-value-disallowed-list': [ + { + '/^(?:color|background|background-color|border|border-color|outline|outline-color)$/': + [/#[0-9a-f]{3}/, /(?:rgb|hsl)a?\(.+?\)/], + content: [/^"\\[0-9a-f]{1,6}"$/i], + }, + { + message: (name, value) => { + switch (name) { + case 'content': { + return `Unicode値 "${value}" を直接指定せず、代わりに命名されたエンティティ(例: ©)またはCSS変数を使用してください。`; + } + default: { + return `ハードコードされた値 "${value}" の代わりにCSS変数を使用してください。`; + } + } + }, + severity: 'warning', + }, + ], 'declaration-property-value-allowed-list': { 'font-size': [ 'inherit', From 09c2e610eb2ece27caeba196c74d46dd1f23ee83 Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Fri, 2 May 2025 12:46:19 +0900 Subject: [PATCH 04/10] =?UTF-8?q?#490=20[Stylelint]=20disallowed-list?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=82=92=E7=94=A8=E6=84=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update: 単位のFeedbackの値を変更(`vm`は存在しないので削除) --- packages/@d-zero/stylelint-config/values.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index 82349022..cf138a83 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -72,15 +72,14 @@ module.exports = { { message: (unit) => { const recommendationMap = { - ex: 'rem', - ch: 'rem', - mm: 'rem', - q: 'rem', - cm: 'rem', - in: 'rem', - pt: 'rem', - pc: 'rem', - vm: 'rem', + ex: 'em, rem', + ch: 'em, rem', + mm: 'px, rem', + q: 'px, rem', + cm: 'px, rem', + in: 'px, rem', + pt: 'px, rem', + pc: 'px, rem', s: 'ms', grad: 'deg', rad: 'deg', From 7e60ca5be5ea7957fc4eb88fcac22e80a2321cbe Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Fri, 2 May 2025 12:48:38 +0900 Subject: [PATCH 05/10] =?UTF-8?q?#490=20[Stylelint]=20disallowed-list?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=82=92=E7=94=A8=E6=84=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Feat: Option: displayの単一構文を禁止 Feat: Option: z-indexの数値指定を禁止 --- packages/@d-zero/stylelint-config/values.js | 78 +++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index cf138a83..d7da7fda 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -10,6 +10,23 @@ module.exports = { rules: { 'declaration-property-value-disallowed-list': [ { + display: [ + /* @see https://drafts.csswg.org/css-display/#display-value-summary */ + 'block', + 'flow-root', + 'inline', + 'inline-block', + 'list-item', + 'inline list-item', + 'flex', + 'inline-flex', + 'grid', + 'inline-grid', + 'ruby', + 'table', + 'inline-table', + ], + 'z-index': ['/^-?\\d+$/'], '/^(?:color|background|background-color|border|border-color|outline|outline-color)$/': [/#[0-9a-f]{3}/, /(?:rgb|hsl)a?\(.+?\)/], content: [/^"\\[0-9a-f]{1,6}"$/i], @@ -17,6 +34,67 @@ module.exports = { { message: (name, value) => { switch (name) { + case 'display': { + let multiValue = ''; + switch (value) { + case 'block': { + multiValue = 'block flow'; + break; + } + case 'flow-root': { + multiValue = 'block flow-root'; + break; + } + case 'inline': { + multiValue = 'inline flow'; + break; + } + case 'inline-block': { + multiValue = 'inline flow-root'; + break; + } + case 'list-item': { + multiValue = 'block flow list-item'; + break; + } + case 'inline list-item': { + multiValue = 'inline flow list-item'; + break; + } + case 'flex': { + multiValue = 'block flex'; + break; + } + case 'inline-flex': { + multiValue = 'inline flex'; + break; + } + case 'grid': { + multiValue = 'block grid'; + break; + } + case 'inline-grid': { + multiValue = 'inline grid'; + break; + } + case 'ruby': { + multiValue = 'inline ruby'; + break; + } + case 'table': { + multiValue = 'block table'; + break; + } + case 'inline-table': { + multiValue = 'inline table'; + break; + } + } + return `\`${name}\`プロパティには2値構文を使用してください。 (\`${value}\` → \`${multiValue}\`)`; + } + case 'z-index': { + return '数値の z-index ではなくグローバルで定義されたCSS変数を使用してください。'; + } case 'content': { return `Unicode値 "${value}" を直接指定せず、代わりに命名されたエンティティ(例: ©)またはCSS変数を使用してください。`; } From d44ecff684cae86c012bd61e84135b273319255a Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Sat, 3 May 2025 20:25:14 +0900 Subject: [PATCH 06/10] =?UTF-8?q?#490=20[Stylelint]=20disallowed-list?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=82=92=E7=94=A8=E6=84=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix: block flow list-item などは3値あるので、「複数キーワード構文」のほうがより適切であるためメッセージを修正 Fix: 各メッセージの表記揺れを修正 --- packages/@d-zero/stylelint-config/values.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index d7da7fda..d229ee21 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -90,16 +90,16 @@ module.exports = { break; } } - return `\`${name}\`プロパティには2値構文を使用してください。 (\`${value}\` → \`${multiValue}\`)`; + return `\`${value}\`の代わりに複数キーワード構文\`${multiValue}\`を使用してください。`; } case 'z-index': { - return '数値の z-index ではなくグローバルで定義されたCSS変数を使用してください。'; + return `数値の\`${name}\`ではなくグローバルで定義されたCSS変数を使用してください。`; } case 'content': { - return `Unicode値 "${value}" を直接指定せず、代わりに命名されたエンティティ(例: ©)またはCSS変数を使用してください。`; + return `Unicode値\`${value}\`を直接指定せず、代わりに命名されたエンティティ(例: ©)またはCSS変数を使用してください。`; } default: { - return `ハードコードされた値 "${value}" の代わりにCSS変数を使用してください。`; + return `ハードコードされた値\`${value}\`の代わりにCSS変数を使用してください。`; } } }, From 51240d20862d92d86e87e3ef87ed698c8246d5cd Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Thu, 3 Jul 2025 13:02:48 +0900 Subject: [PATCH 07/10] =?UTF-8?q?#490=20[Stylelint]=20disallowed-list?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=99=E3=82=8B=E6=99=82=E3=81=AF?= =?UTF-8?q?=E5=9B=9E=E7=AD=94=E3=82=92=E7=94=A8=E6=84=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix: contentメッセージ変更 --- packages/@d-zero/stylelint-config/values.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index d229ee21..8247f4ff 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -96,7 +96,7 @@ module.exports = { return `数値の\`${name}\`ではなくグローバルで定義されたCSS変数を使用してください。`; } case 'content': { - return `Unicode値\`${value}\`を直接指定せず、代わりに命名されたエンティティ(例: ©)またはCSS変数を使用してください。`; + return `Unicode値 "${value}" を指定せず、表示したいテキストをそのまま指定してください。`; } default: { return `ハードコードされた値\`${value}\`の代わりにCSS変数を使用してください。`; From 5b0f652019e1507b6f05bf27a6cba726f78c4e18 Mon Sep 17 00:00:00 2001 From: Takahiro A Date: Thu, 3 Jul 2025 13:26:44 +0900 Subject: [PATCH 08/10] =?UTF-8?q?#490=20[Stylelint]=20=E3=82=A8=E3=83=A9?= =?UTF-8?q?=E3=83=BC=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=AE?= =?UTF-8?q?=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=83=88=E3=82=92?= =?UTF-8?q?=E7=B5=B1=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/@d-zero/stylelint-config/values.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@d-zero/stylelint-config/values.js b/packages/@d-zero/stylelint-config/values.js index 8247f4ff..f1a68d99 100644 --- a/packages/@d-zero/stylelint-config/values.js +++ b/packages/@d-zero/stylelint-config/values.js @@ -96,7 +96,7 @@ module.exports = { return `数値の\`${name}\`ではなくグローバルで定義されたCSS変数を使用してください。`; } case 'content': { - return `Unicode値 "${value}" を指定せず、表示したいテキストをそのまま指定してください。`; + return `Unicode値\`${value}\`を指定せず、表示したいテキストをそのまま指定してください。`; } default: { return `ハードコードされた値\`${value}\`の代わりにCSS変数を使用してください。`; From 41bd1bdf97b592ab5577367c65ee53f02439495f Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Mon, 5 Jan 2026 14:56:46 +0900 Subject: [PATCH 09/10] test(stylelint-rules): update tests to match new error messages --- test/cli.spec.mjs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/test/cli.spec.mjs b/test/cli.spec.mjs index e8c192f2..6276dc5b 100644 --- a/test/cli.spec.mjs +++ b/test/cli.spec.mjs @@ -236,7 +236,9 @@ describe('stylelint', () => { 'test/fixtures/stylelint/values.scss:18:15 Unexpected value "200%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/values.scss:19:15 Unexpected value "999%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/values.scss:20:15 Unexpected value "1000%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', + 'test/fixtures/stylelint/values.scss:21:34 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', 'test/fixtures/stylelint/values.scss:22:31 Unexpected value "1vw" for type "length" (@d-zero/declaration-value-type-disallowed-list)', + 'test/fixtures/stylelint/values.scss:22:32 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', ]); }); @@ -251,29 +253,39 @@ describe('stylelint', () => { 'test/fixtures/stylelint/unit.scss:13:13 Unexpected value "1.2em" for property "font-size" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:14:13 Unexpected value "0.5em" for property "font-size" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:15:13 Unexpected value "4vw" for property "font-size" (declaration-property-value-allowed-list)', + 'test/fixtures/stylelint/unit.scss:15:14 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:20:17 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:23:26 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:26:40 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', 'test/fixtures/stylelint/unit.scss:32:13 Unexpected value "16px" for property "font-size" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:34:13 Unexpected value "16ex" for property "font-size" (declaration-property-value-allowed-list)', - 'test/fixtures/stylelint/unit.scss:34:15 Unexpected unit "ex" (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:34:15 `ex`は使用しないでください。代わりに`em, rem`を検討してください。', 'test/fixtures/stylelint/unit.scss:35:13 Unexpected value "16pt" for property "font-size" (declaration-property-value-allowed-list)', - 'test/fixtures/stylelint/unit.scss:35:15 Unexpected unit "pt" (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:35:15 `pt`は使用しないでください。代わりに`px, rem`を検討してください。', 'test/fixtures/stylelint/unit.scss:36:13 Unexpected value "16cm" for property "font-size" (declaration-property-value-allowed-list)', - 'test/fixtures/stylelint/unit.scss:36:15 Unexpected unit "cm" (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:36:15 `cm`は使用しないでください。代わりに`px, rem`を検討してください。', 'test/fixtures/stylelint/unit.scss:45:15 Expected "400" to be "normal" (font-weight-notation)', 'test/fixtures/stylelint/unit.scss:57:16 Unexpected unit (length-zero-no-unit)', + 'test/fixtures/stylelint/unit.scss:63:21 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:64:21 `vh`は使用しないでください。代わりに`svh, dvh, lvh`を検討してください。', 'test/fixtures/stylelint/unit.scss:67:15 Unexpected value "5%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:68:15 Unexpected value "50%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:69:14 Unexpected value "33.3%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:72:34 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', 'test/fixtures/stylelint/unit.scss:74:36 Unexpected value "54.2vw" for type "length-percentage" (@d-zero/declaration-value-type-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:74:40 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', 'test/fixtures/stylelint/unit.scss:75:23 Unexpected value "2vw" for type "length" (@d-zero/declaration-value-type-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:75:24 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', 'test/fixtures/stylelint/unit.scss:76:23 Unexpected value "50vh" for type "length" (@d-zero/declaration-value-type-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:76:25 `vh`は使用しないでください。代わりに`svh, dvh, lvh`を検討してください。', 'test/fixtures/stylelint/unit.scss:77:19 Unexpected value "105%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:78:19 Unexpected value "120%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:79:19 Unexpected value "200%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:80:19 Unexpected value "1000%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:81:17 Unexpected value "105%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:83:17 Unexpected unit "ex" (unit-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:84:17 Unexpected unit "pt" (unit-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:85:17 Unexpected unit "cm" (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:83:17 `ex`は使用しないでください。代わりに`em, rem`を検討してください。', + 'test/fixtures/stylelint/unit.scss:84:17 `pt`は使用しないでください。代わりに`px, rem`を検討してください。', + 'test/fixtures/stylelint/unit.scss:85:17 `cm`は使用しないでください。代わりに`px, rem`を検討してください。', 'test/fixtures/stylelint/unit.scss:95:8 Unexpected value "0 2 calc(100% / 3)" for property "flex" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:98:13 Unexpected value "2" for property "flex-grow" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:101:15 Unexpected value "2" for property "flex-shrink" (declaration-property-value-allowed-list)', From a2bd2b1b6efdd7bacedb5167acbff809c9ca20b2 Mon Sep 17 00:00:00 2001 From: Yusuke Hirao Date: Mon, 5 Jan 2026 15:17:05 +0900 Subject: [PATCH 10/10] test(stylelint-rules): add rule name suffix to error messages after dev merge --- test/cli.spec.mjs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/test/cli.spec.mjs b/test/cli.spec.mjs index 6d894db1..522e4837 100644 --- a/test/cli.spec.mjs +++ b/test/cli.spec.mjs @@ -264,9 +264,9 @@ describe('stylelint', () => { 'test/fixtures/stylelint/values.scss:18:15 Unexpected value "200%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/values.scss:19:15 Unexpected value "999%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/values.scss:20:15 Unexpected value "1000%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/values.scss:21:34 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/values.scss:21:34 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/values.scss:22:31 Unexpected value "1vw" for type "length" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/values.scss:22:32 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/values.scss:22:32 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', ]); }); @@ -281,39 +281,39 @@ describe('stylelint', () => { 'test/fixtures/stylelint/unit.scss:13:13 Unexpected value "1.2em" for property "font-size" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:14:13 Unexpected value "0.5em" for property "font-size" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:15:13 Unexpected value "4vw" for property "font-size" (declaration-property-value-allowed-list)', - 'test/fixtures/stylelint/unit.scss:15:14 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', - 'test/fixtures/stylelint/unit.scss:20:17 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', - 'test/fixtures/stylelint/unit.scss:23:26 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', - 'test/fixtures/stylelint/unit.scss:26:40 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:15:14 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:20:17 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:23:26 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:26:40 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:32:13 Unexpected value "16px" for property "font-size" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:34:13 Unexpected value "16ex" for property "font-size" (declaration-property-value-allowed-list)', - 'test/fixtures/stylelint/unit.scss:34:15 `ex`は使用しないでください。代わりに`em, rem`を検討してください。', + 'test/fixtures/stylelint/unit.scss:34:15 `ex`は使用しないでください。代わりに`em, rem`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:35:13 Unexpected value "16pt" for property "font-size" (declaration-property-value-allowed-list)', - 'test/fixtures/stylelint/unit.scss:35:15 `pt`は使用しないでください。代わりに`px, rem`を検討してください。', + 'test/fixtures/stylelint/unit.scss:35:15 `pt`は使用しないでください。代わりに`px, rem`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:36:13 Unexpected value "16cm" for property "font-size" (declaration-property-value-allowed-list)', - 'test/fixtures/stylelint/unit.scss:36:15 `cm`は使用しないでください。代わりに`px, rem`を検討してください。', + 'test/fixtures/stylelint/unit.scss:36:15 `cm`は使用しないでください。代わりに`px, rem`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:45:15 Expected "400" to be "normal" (font-weight-notation)', 'test/fixtures/stylelint/unit.scss:57:16 Unexpected unit (length-zero-no-unit)', - 'test/fixtures/stylelint/unit.scss:63:21 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', - 'test/fixtures/stylelint/unit.scss:64:21 `vh`は使用しないでください。代わりに`svh, dvh, lvh`を検討してください。', + 'test/fixtures/stylelint/unit.scss:63:21 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:64:21 `vh`は使用しないでください。代わりに`svh, dvh, lvh`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:67:15 Unexpected value "5%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:68:15 Unexpected value "50%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:69:14 Unexpected value "33.3%" for type "percentage" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:72:34 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:72:34 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:74:36 Unexpected value "54.2vw" for type "length-percentage" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:74:40 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:74:40 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:75:23 Unexpected value "2vw" for type "length" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:75:24 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。', + 'test/fixtures/stylelint/unit.scss:75:24 `vw`は使用しないでください。代わりに`svw, dvw, lvw`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:76:23 Unexpected value "50vh" for type "length" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:76:25 `vh`は使用しないでください。代わりに`svh, dvh, lvh`を検討してください。', + 'test/fixtures/stylelint/unit.scss:76:25 `vh`は使用しないでください。代わりに`svh, dvh, lvh`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:77:19 Unexpected value "105%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:78:19 Unexpected value "120%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:79:19 Unexpected value "200%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:80:19 Unexpected value "1000%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', 'test/fixtures/stylelint/unit.scss:81:17 Unexpected value "105%" for type "length" (@d-zero/declaration-value-type-disallowed-list)', - 'test/fixtures/stylelint/unit.scss:83:17 `ex`は使用しないでください。代わりに`em, rem`を検討してください。', - 'test/fixtures/stylelint/unit.scss:84:17 `pt`は使用しないでください。代わりに`px, rem`を検討してください。', - 'test/fixtures/stylelint/unit.scss:85:17 `cm`は使用しないでください。代わりに`px, rem`を検討してください。', + 'test/fixtures/stylelint/unit.scss:83:17 `ex`は使用しないでください。代わりに`em, rem`を検討してください。 (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:84:17 `pt`は使用しないでください。代わりに`px, rem`を検討してください。 (unit-disallowed-list)', + 'test/fixtures/stylelint/unit.scss:85:17 `cm`は使用しないでください。代わりに`px, rem`を検討してください。 (unit-disallowed-list)', 'test/fixtures/stylelint/unit.scss:95:8 Unexpected value "0 2 calc(100% / 3)" for property "flex" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:98:13 Unexpected value "2" for property "flex-grow" (declaration-property-value-allowed-list)', 'test/fixtures/stylelint/unit.scss:101:15 Unexpected value "2" for property "flex-shrink" (declaration-property-value-allowed-list)',