mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-21 03:48:36 -05:00
fix(typescript): add node_modules/** to tslint default excludes (#1200)
close #1194
This commit is contained in:
committed by
Evan You
parent
be713a6bec
commit
a6e47cee61
@@ -67,3 +67,24 @@ test('should not fix with --no-fix option', async () => {
|
||||
expect(await read('src/main.ts')).not.toMatch(';')
|
||||
expect((await read('src/App.vue')).match(/<script(.|\n)*\/script>/)[1]).not.toMatch(';')
|
||||
})
|
||||
|
||||
test('should ignore issues in node_modules', async () => {
|
||||
const project = await create('ts-lint-node_modules', {
|
||||
plugins: {
|
||||
'@vue/cli-plugin-typescript': {
|
||||
tsLint: true
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const { read, write, run } = project
|
||||
const main = await read('src/main.ts')
|
||||
|
||||
// update file to not match tslint spec and dump it into the node_modules directory
|
||||
const updatedMain = main.replace(/;/g, '')
|
||||
await write('node_modules/bad.ts', updatedMain)
|
||||
|
||||
// lint
|
||||
await run('vue-cli-service lint')
|
||||
expect(await read('node_modules/bad.ts')).toMatch(updatedMain)
|
||||
})
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
"extends": [
|
||||
"tslint:recommended"
|
||||
],
|
||||
"linterOptions": {
|
||||
"exclude": [
|
||||
"node_modules/**"
|
||||
]
|
||||
},
|
||||
"rules": {
|
||||
"quotemark": [true, "single"],
|
||||
"indent": [true, "spaces", 2],
|
||||
|
||||
Reference in New Issue
Block a user