Skip to content

Commit 189ea54

Browse files
armano2haoqunjiang
authored andcommittedJan 30, 2019
feat: update eslint-config-typescript to use @typescript-eslint (#3359)
1 parent b61ea45 commit 189ea54

File tree

8 files changed

+14
-16
lines changed

8 files changed

+14
-16
lines changed
 

‎packages/@vue/cli-plugin-eslint/__tests__/eslintGenerator.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ test('typescript', async () => {
100100
'@vue/typescript'
101101
])
102102
expect(pkg.eslintConfig.parserOptions).toEqual({
103-
parser: 'typescript-eslint-parser'
103+
parser: '@typescript-eslint/parser'
104104
})
105105
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-prettier')
106106
expect(pkg.devDependencies).toHaveProperty('@vue/eslint-config-typescript')

‎packages/@vue/cli-plugin-eslint/generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const applyTS = module.exports.applyTS = api => {
113113
eslintConfig: {
114114
extends: ['@vue/typescript'],
115115
parserOptions: {
116-
parser: 'typescript-eslint-parser'
116+
parser: '@typescript-eslint/parser'
117117
}
118118
},
119119
devDependencies: {

‎packages/@vue/cli-plugin-typescript/generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = (api, {
99

1010
api.extendPackage({
1111
devDependencies: {
12-
typescript: api.hasPlugin('eslint') ? '~3.1.1' : '^3.0.0'
12+
typescript: api.hasPlugin('eslint') ? '~3.2.2' : '^3.0.0'
1313
}
1414
})
1515

‎packages/@vue/cli-plugin-typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@types/chai": "^4.1.0",
3737
"@types/jest": "^23.1.4",
3838
"@types/mocha": "^5.2.4",
39-
"typescript": "~3.1.1",
39+
"typescript": "~3.2.2",
4040
"vue-class-component": "^6.2.0",
4141
"vue-property-decorator": "^7.0.0"
4242
}

‎packages/@vue/cli/__tests__/invoke.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ test('invoke with ts', async () => {
103103
expect(updatedESLintrc).toEqual(Object.assign({}, baseESLintConfig, {
104104
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/typescript'],
105105
parserOptions: {
106-
parser: 'typescript-eslint-parser'
106+
parser: '@typescript-eslint/parser'
107107
}
108108
}))
109109
})

‎packages/@vue/eslint-config-typescript/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
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
}

‎packages/@vue/eslint-config-typescript/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)
Please sign in to comment.