Skip to content

Commit d733860

Browse files
armano2haoqunjiang
authored andcommitted
feat: update eslint-config-typescript to use @typescript-eslint (#3359)
1 parent 835e679 commit d733860

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> eslint-config-typescript for vue-cli
44
5-
See [eslint-plugin-typescript](https://github.com/nzakas/eslint-plugin-typescript) for available rules.
5+
See [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/eslint-plugin) for available rules.
66

77
This config is specifically designed to be used by `vue-cli` setups
88
and is not meant for outside use (it can be used but some adaptations

index.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
module.exports = {
2-
plugins: ['typescript'],
2+
plugins: ['@typescript-eslint'],
33
// Prerequisite `eslint-plugin-vue`, being extended, sets
44
// root property `parser` to `'vue-eslint-parser'`, which, for code parsing,
55
// in turn delegates to the parser, specified in `parserOptions.parser`:
66
// https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error
77
parserOptions: {
8-
parser: require.resolve('typescript-eslint-parser'),
9-
// #3268
10-
jsx: true
8+
parser: require.resolve('@typescript-eslint/parser')
119
},
1210
rules: {
13-
// https://github.com/eslint/typescript-eslint-parser#known-issues
11+
// https://typescript-eslint.io/parser
1412
'no-undef': 'off',
1513
'no-unused-vars': 'off',
16-
// https://github.com/eslint/typescript-eslint-parser/issues/445
17-
// 'typescript/no-unused-vars': 'error',
14+
// https://github.com/typescript-eslint/typescript-eslint/issues/46
15+
// '@typescript-eslint/no-unused-vars': 'error',
1816

1917
// temporary fix for https://github.com/vuejs/vue-cli/issues/1922
2018
// very strange as somehow this rule gets different behaviors depending
21-
// on the presence of typescript-eslint-parser...
19+
// on the presence of @typescript-eslint/parser...
2220
'strict': 'off'
2321
}
2422
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"homepage": "https://github.com/vuejs/vue-cli/tree/dev/packages/@vue/eslint-config-typescript#readme",
2323
"dependencies": {
24-
"eslint-plugin-typescript": "^0.14.0",
25-
"typescript-eslint-parser": "^21.0.2"
24+
"@typescript-eslint/eslint-plugin": "^1.1.0",
25+
"@typescript-eslint/parser": "^1.1.0"
2626
}
2727
}

0 commit comments

Comments
 (0)