From 76439fdac875c6dd58865bae0fc28262870758bb Mon Sep 17 00:00:00 2001 From: tunguyen-ct Date: Wed, 20 Sep 2023 15:48:42 +0700 Subject: [PATCH] feat: make no unused var error --- .changeset/orange-flies-greet.md | 5 +++++ packages/eslint-config-base/src/rulesets.js | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/orange-flies-greet.md diff --git a/.changeset/orange-flies-greet.md b/.changeset/orange-flies-greet.md new file mode 100644 index 0000000..7ac500f --- /dev/null +++ b/.changeset/orange-flies-greet.md @@ -0,0 +1,5 @@ +--- +'@chotot/eslint-config-base': patch +--- + +turn off no-unused-vars for ts file, this is handled by typescript-eslint plugin, also make it error instead of warning diff --git a/packages/eslint-config-base/src/rulesets.js b/packages/eslint-config-base/src/rulesets.js index 2d47dde..dd96748 100644 --- a/packages/eslint-config-base/src/rulesets.js +++ b/packages/eslint-config-base/src/rulesets.js @@ -815,6 +815,7 @@ const typescriptEslintPluginRules = { 'no-extra-semi': 'off', 'no-loss-of-precision': 'off', 'no-shadow': 'off', + 'no-unused-vars': 'off', // Require that function overload signatures be consecutive. // https://typescript-eslint.io/rules/adjacent-overload-signatures '@typescript-eslint/adjacent-overload-signatures': 'error', @@ -1138,7 +1139,7 @@ const typescriptEslintPluginRules = { '@typescript-eslint/no-loss-of-precision': 'error', // Disallow unused variables. // https://typescript-eslint.io/rules/no-unused-vars - '@typescript-eslint/no-unused-vars': 'warn', + '@typescript-eslint/no-unused-vars': 'error', // Disallow empty functions. // https://typescript-eslint.io/rules/no-empty-function '@typescript-eslint/no-empty-function': 'off',