Skip to content

Commit

Permalink
fix: turn on ts-eslint version of no-unused-vars for ts & vue files
Browse files Browse the repository at this point in the history
Fixes #14
Fixes vuejs/create-vue#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.
  • Loading branch information
haoqunjiang committed Sep 6, 2022
1 parent 75a6bde commit 374aa73
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}
]
Expand Down

0 comments on commit 374aa73

Please sign in to comment.