-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Use tslint-config-prettier for typescript #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does |
Right now it disables conflicting rules, so yeah it assumes prettier is already configured. In that way, it works just as eslint-config-prettier. |
That would be great (TSLint + Prettier option in the CLI) |
you can simply {
"extends": [
"tslint-config-prettier"
],
"rulesDirectory": ["tslint-plugin-prettier"],
"rules": {
"prettier": true
}
} the only problem i had with this is that when running the problem is here: this pads the extracted script with newlines (see https://www.npmjs.com/package/vue-template-compiler#pad ) |
ok i have found out what the problem is: vue-cli-service lint uses parseComponent from vue-template-compiler. vue-template-compiler does this too, but only if no script lang is specified: (and since v0.4.4 fork-ts-checker-webpack-plugin will use vue-template-compiler too insteadof vue-parser) so changes to parseComponent need to be made to comment out the padding for linting |
Is there a temporary workaround for this or are you just ignoring those error messages? |
There is no workaround. There needs to be an option in vue-template-compilers parseComponent to comment out newlines (like vue-parser does) when |
this avoids manipulating the tslint ruleset, which is only necessary because the padding of vueCompiler does not work for lang="ts" scripts. this also makes vue-cli tslint work with tslint-plugin-prettier prereq for: vuejs#761 unexpected upstream behavior: https://github.com/vuejs/vue/blob/dev/src/sfc/parser.js#L119
i have opened a PR which fixes script content padding inside the vue-cli tslint command |
Now that TSLint is officially deprecated, TSLint support will be fully dropped in the next major version; as for the current major version, no more bug fixes or features will be implemented except for security reasons. So I'm closing this issue now. |
What problem does this feature solve?
Similar to how the new vue-cli 3 has eslint-config-prettier in order to use both without conflicts, I think it can be useful to add tslint-config-prettier to achieve the same thing when using typescript.
What does the proposed API look like?
It should be transparent to the user as long as it selects typescript and a formatter on the cli questions
The text was updated successfully, but these errors were encountered: