3.0.0-rc.3
https://github.com/hdurix/vue-consecutive-empty-lines
Create a TypeScript project using vue cli.
Set no-consecutive-blank-lines to true (or remove it) in tslint.json
Change HelloWorld.vue to extract TypeScript in a dedicated file (HelloWorld.ts)
In HelloWorld.ts, add two consecutive empty lines.
In App.vue, add // @ts-ignore before the import statement (more information in https://github.com/vuejs/vue-cli/issues/1576)
Launch npm run lint.
Consecutive empty lines are replaced by only one empty line.
The prompt says: No lint errors found.
The same thing works if we call directly tslint using tslint --project . --fix or if we run npm run serve.
I think, it comes from: https://github.com/vuejs/vue-cli/blob/838f6a2b662075fa48047f751b4510ec11da3fa9/packages/%40vue/cli-plugin-typescript/lib/tslint.js#L24-L26.
It's explained in the comment just above: https://github.com/vuejs/vue-cli/blob/838f6a2b662075fa48047f751b4510ec11da3fa9/packages/%40vue/cli-plugin-typescript/lib/tslint.js#L20
So @Akryum, why, there is a different behaviour between npm run serve and npm run lint?
Note: the problem is not with the Vue file but with the dedicated TypeScript file.
Is there a documentation to explain why some tslint rules are not allowed?
there is a different behaviour between npm run serve and npm run lint
It wans't clear to me from your issue.
why, there is a different behaviour between npm run serve and npm run lint?
I guess its because npm run serve runs tslint as part of a webpack build process and npm run lint calls a monkey-patched tslint directly. in the webpack process the rule isnt disabled.
Exactly. And we patch tslint in the lint script to make it work with .vue files. It's a necessary hack.
Most helpful comment
So @Akryum, why, there is a different behaviour between
npm run serveandnpm run lint?Note: the problem is not with the Vue file but with the dedicated TypeScript file.
Is there a documentation to explain why some tslint rules are not allowed?