From 374aa73c1381e106c1b49e9a5002cd5e407959ac Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Tue, 6 Sep 2022 22:35:34 +0800 Subject: [PATCH] fix: turn on ts-eslint version of no-unused-vars for ts & vue files Fixes https://github.com/vuejs/eslint-config-typescript/issues/14 Fixes https://github.com/vuejs/create-vue/issues/158 Technically turning new rules on would be a breaking change because it introduces more errors in an existing codebase. However, in our README we've already made it clear that this ruleset should only be used with `@vue/cli` or `create-vue`, so an existing `eslint:recommended` config is expected, thus no breaking changes. Nevertheless, I choose to make it `warn` instead of `error` to minimize the impact. --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 36e6b55..7a7c6e9 100644 --- a/index.js +++ b/index.js @@ -27,11 +27,12 @@ module.exports = { overrides: [ { - files: ['*.ts', '*.tsx'], + files: ['*.ts', '*.tsx', '.vue'], rules: { // The core 'no-unused-vars' rules (in the eslint:recommeded ruleset) // does not work with type definitions 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': 'warn' } } ]