From eafede0894c5987ad1ab7ab0536adc312eea9f4f Mon Sep 17 00:00:00 2001 From: Taka07 Date: Tue, 26 Sep 2023 00:54:09 +0900 Subject: [PATCH 1/3] =?UTF-8?q?undefined=E3=81=A8null=E3=81=AE=E5=8E=B3?= =?UTF-8?q?=E5=AF=86=E6=AF=94=E8=BC=83=E3=82=92=E7=A6=81=E6=AD=A2=E3=81=99?= =?UTF-8?q?=E3=82=8B=E8=A8=AD=E5=AE=9A=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 26947de566..a334438900 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -56,6 +56,25 @@ module.exports = { }, ], "import/order": "error", + "no-restricted-syntax": [ + "error", + { + selector: "BinaryExpression[operator='==='][right.value=null]", + message: "Don't use '=== null'. Use '== null' instead.", + }, + { + selector: "BinaryExpression[operator='!=='][right.value=null]", + message: "Don't use '!== null'. Use '== null' instead.", + }, + { + selector: "BinaryExpression[operator='==='][right.value=undefined]", + message: "Don't use '=== undefined'. Use '== undefined' instead.", + }, + { + selector: "BinaryExpression[operator='!=='][right.value=undefined]", + message: "Don't use '!== undefined'. Use '== undefined' instead.", + }, + ], }, overrides: [ { From 1171b6156d88abe1cbd8a8befb6d993446bac63b Mon Sep 17 00:00:00 2001 From: Taka07 Date: Tue, 26 Sep 2023 22:00:06 +0900 Subject: [PATCH 2/3] =?UTF-8?q?message=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index a334438900..72b4ec20e1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -64,7 +64,7 @@ module.exports = { }, { selector: "BinaryExpression[operator='!=='][right.value=null]", - message: "Don't use '!== null'. Use '== null' instead.", + message: "Don't use '!== null'. Use '!= null' instead.", }, { selector: "BinaryExpression[operator='==='][right.value=undefined]", @@ -72,7 +72,7 @@ module.exports = { }, { selector: "BinaryExpression[operator='!=='][right.value=undefined]", - message: "Don't use '!== undefined'. Use '== undefined' instead.", + message: "Don't use '!== undefined'. Use '!= undefined' instead.", }, ], }, From d53fb6add519465f78395d4facb73862e47329ce Mon Sep 17 00:00:00 2001 From: Taka07 Date: Wed, 27 Sep 2023 22:47:42 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E8=AA=A4=E6=A4=9C=E5=87=BA=E3=81=AA?= =?UTF-8?q?=E3=81=8F=E5=87=BA=E3=81=97=E3=81=9F=E3=81=84=E7=AE=87=E6=89=80?= =?UTF-8?q?=E3=81=AE=E3=81=BFwarning=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=AB?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 72b4ec20e1..3abaecc545 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -57,22 +57,30 @@ module.exports = { ], "import/order": "error", "no-restricted-syntax": [ - "error", + "warn", { - selector: "BinaryExpression[operator='==='][right.value=null]", - message: "Don't use '=== null'. Use '== null' instead.", + selector: + "BinaryExpression[operator='==='][right.type='Literal'][right.value=null]", + message: + "'=== null'ではなく'== null'を使用してください。詳細: https://github.com/VOICEVOX/voicevox/issues/1513", }, { - selector: "BinaryExpression[operator='!=='][right.value=null]", - message: "Don't use '!== null'. Use '!= null' instead.", + selector: + "BinaryExpression[operator='!=='][right.type='Literal'][right.value=null]", + message: + "'!== null'ではなく'!= null'を使用してください。詳細: https://github.com/VOICEVOX/voicevox/issues/1513", }, { - selector: "BinaryExpression[operator='==='][right.value=undefined]", - message: "Don't use '=== undefined'. Use '== undefined' instead.", + selector: + "BinaryExpression[operator='==='][right.type='Identifier'][right.name=undefined]", + message: + "'=== undefined'ではなく'== undefined'を使用してください。詳細: https://github.com/VOICEVOX/voicevox/issues/1513", }, { - selector: "BinaryExpression[operator='!=='][right.value=undefined]", - message: "Don't use '!== undefined'. Use '!= undefined' instead.", + selector: + "BinaryExpression[operator='!=='][right.type='Identifier'][right.name=undefined]", + message: + "'!== undefined'ではなく'!= undefined'を使用してください。詳細: https://github.com/VOICEVOX/voicevox/issues/1513", }, ], },