Skip to content

Commit af495e1

Browse files
committed
chore: upgrade typescript around deps
1 parent f553484 commit af495e1

File tree

9 files changed

+349
-332
lines changed

9 files changed

+349
-332
lines changed

.eslintrc.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ module.exports = {
99
extends: [
1010
'eslint:recommended',
1111
'plugin:@typescript-eslint/eslint-recommended',
12-
'plugin:@typescript-eslint/recommended',
13-
'plugin:vue-libs/recommended'
12+
'plugin:@typescript-eslint/recommended'
1413
],
1514
plugins: [
1615
'@typescript-eslint'
1716
],
18-
parser: 'vue-eslint-parser',
1917
parserOptions: {
2018
parser: '@typescript-eslint/parser',
2119
sourceType: 'module'

package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,16 @@
4242
"@types/node": "^12.6.8",
4343
"@types/prettier": "^2.0.0",
4444
"@types/yargs": "^15.0.0",
45-
"@typescript-eslint/eslint-plugin": "^3.0.0",
46-
"@typescript-eslint/parser": "^3.0.0",
45+
"@typescript-eslint/eslint-plugin": "^5.59.5",
46+
"@typescript-eslint/parser": "^5.59.5",
4747
"bumpp": "^9.1.0",
48-
"eslint": "^7.4.0",
49-
"eslint-plugin-vue-libs": "^4.0.0",
48+
"eslint": "^8.40.0",
5049
"jest": "^26.0.0",
5150
"jest-watch-typeahead": "^0.6.0",
5251
"opener": "^1.5.1",
5352
"ts-jest": "^26.0.0",
5453
"tsd": "^0.13.0",
55-
"typescript": "^3.9.5",
56-
"typescript-eslint-language-service": "^3.0.0",
54+
"typescript": "^4.9.5",
5755
"vue": "^2.6.11",
5856
"vue-template-compiler": "^2.6.11"
5957
},
@@ -85,7 +83,7 @@
8583
"scripts": {
8684
"build": "tsc -p .",
8785
"build:watch": "tsc -p . --watch",
88-
"clean": "rm -rf ./coverage",
86+
"clean": "rm -rf ./coverage && rm -rf ./lib",
8987
"coverage": "opener coverage/lcov-report/index.html",
9088
"lint": "eslint ./src ./test --ext .ts --ignore-pattern \"*.test.*\"",
9189
"release": "bumpp --commit \"release: v%s\" --push --tag",

src/commands/import.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const handler = async (args: Arguments<ImportOptions>): Promise<unknown>
9191
await provider.import({ messages, dryRun })
9292
// TODO: should refactor console message
9393
console.log('import success')
94-
} catch (e) {
94+
} catch (e: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
9595
// TODO: should refactor console message
9696
console.error('import fail:', e.message)
9797
}

src/commands/squeeze.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function splitLocaleMessages (path: string, messages: LocaleMessages) {
176176
try {
177177
fs.mkdirSync(path)
178178
write()
179-
} catch (err) {
179+
} catch (err: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
180180
if (err.code === 'EEXIST') {
181181
write()
182182
} else {

src/commands/status.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const handler = async (args: Arguments<StatusOptions>): Promise<unknown>
4949
return completes.length > 0
5050
? Promise.reject(new TranslationStatusError('Translation work in progress'))
5151
: Promise.resolve('Translation done')
52-
} catch (e) {
52+
} catch (e: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
5353
console.error(e.message)
5454
return Promise.reject(e)
5555
}

src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ export async function pushFunc (options: PushOptions): Promise<unknown> {
609609
messages, dryRun: options.dryRun, normalize: options.normalize,
610610
providerArgs: options.providerArgs !== undefined ? querystring.parse(options.providerArgs) : undefined
611611
})
612-
} catch (e) {
612+
} catch (e: any) { // eslint-disable-line @typescript-eslint/no-explicit-any
613613
// TODO: should refactor message
614614
console.error('push fail:', e.message)
615615
return Promise.reject()

test/utils.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jest.mock('@scope/l10n-service-provider', () => {
2727
return { status: mockStatus, pull: mockPull }
2828
})
2929
})
30+
// @ts-ignore
3031
import L10nServiceProvider from '@scope/l10n-service-provider'
3132

3233
test('reflectSFCDescriptor', () => {

tsconfig.json

-5
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,5 @@
6767
},
6868
"include": [
6969
"src"
70-
],
71-
"plugins": [
72-
{
73-
"name": "typescript-eslint-language-service"
74-
}
7570
]
7671
}

0 commit comments

Comments
 (0)