From 8902864faf945d80c48def6ba5e728cbe677de58 Mon Sep 17 00:00:00 2001 From: Ira Hopkinson Date: Fri, 15 Nov 2024 04:23:12 +1300 Subject: [PATCH] improve linting (#85) - use the TS version of `class-methods-use-this` so we can ignore override methods. --- .eslintrc.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index c1de14e..455f1e1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,7 +33,11 @@ module.exports = { // Rules in each section are generally in alphabetical order. However, several // `@typescript-eslint` rules require disabling the equivalent ESLint rule. So in these cases // each ESLint rule is turned off immediately above the corresponding `@typescript-eslint` rule. - 'import/no-anonymous-default-export': ['error', { allowCallExpression: false }], + 'class-methods-use-this': 'off', + '@typescript-eslint/class-methods-use-this': [ + 'error', + { ignoreOverrideMethods: true, ignoreClassesThatImplementAnInterface: false }, + ], '@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }], 'lines-between-class-members': 'off', '@typescript-eslint/lines-between-class-members': [ @@ -76,6 +80,7 @@ module.exports = { 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'error', 'comma-dangle': ['error', 'always-multiline'], + 'import/no-anonymous-default-export': ['error', { allowCallExpression: false }], indent: 'off', 'jsx-a11y/label-has-associated-control': [ 'error',