From 95cd245055658c14df3e36a2570aeb60883d6dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leslie=20Leigh=20=28=E6=9D=8E=E7=9A=84=E5=BA=8F=29?= Date: Mon, 31 Jul 2023 14:21:36 +0800 Subject: [PATCH] ESLint: replace no-empty-function with typescript version (#15732) --- .eslintrc.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 09f5032bf3..397a8ee08d 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -61,6 +61,7 @@ rules: quotes: [warn, single, { allowTemplateLiterals: true }] # force single, but allow template literal no-else-return: off # else-return is a common pattern which clearly expresses the control flow no-unused-expressions: off # taken over by '@typescript-eslint/no-unused-expressions' + no-empty-function: off # taken over by '@typescript-eslint/no-empty-function' ##### AIRBNB-SPECIFIC RULE OVERRIDES ##### @@ -126,7 +127,16 @@ rules: '@typescript-eslint/unbound-method': off # we exploit prototype methods sometimes to acheive better performace '@typescript-eslint/no-explicit-any': off # still relevant for some heavily templated usages - '@typescript-eslint/no-empty-function': off # may become useful in some parent classes + + '@typescript-eslint/no-empty-function': [error, { + allow: [ + private-constructors, + protected-constructors, + decoratedFunctions, + overrideMethods, + ] + }] + '@typescript-eslint/no-unused-vars': off # may become useful in some parent classes '@typescript-eslint/no-non-null-assertion': off # sometimes we just know better than the compiler '@typescript-eslint/no-namespace': [warn, { # we need to declare static properties