fix(typescript): add node_modules/** to tslint default excludes (#1200)

close #1194
This commit is contained in:
Derek Henscheid
2018-04-30 12:43:48 -05:00
committed by Evan You
parent be713a6bec
commit a6e47cee61
2 changed files with 26 additions and 0 deletions
@@ -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],