-
Notifications
You must be signed in to change notification settings - Fork 13
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
[prettier-vscode] max-line-length does not work #15
Comments
Well shucks I thought I finally found a combination of config for vscode that would provide live tslint warnings, including ones that need type information -- most critically warnings about "floating promises", only provided by tslint-language-service -- as well as auto-formatting on-save based on my tslint settings, which is provided by the vscode-tslint plugin, but then I get duplicate tslint warnings. So I turned to the Prettier vscode extension and prettier-tslint, which actually seems to work perfectly except for the line length. Is there any solution to this currently? Edit: looks like back to vscode-tslint because of this issue. |
Yes, not working 😒 prettier has When VSCode settings.json. (Correct if anything wrong / unnecessary) {
"editor.formatOnSave": true,
"editor.tabSize": 2,
"eslint.autoFixOnSave": true,
"eslint.packageManager": "yarn",
"git.autofetch": true,
"npm.packageManager": "yarn",
"prettier.eslintIntegration": true,
"prettier.printWidth": 120,
"prettier.tslintIntegration": true,
"tslint.autoFixOnSave": true,
"tslint.packageManager": "yarn"
}
DIsclaimer: I have prettier, eslint and tslint plugins installed in VSCode. Nothing installed as local or global dependency (prettier reference) |
I think labeling this as "Bug" would be more appropriate than "Enhancement" as enabling |
You cannot use tslint's If the opposite (ie: using Prettier's If it's still not working, please provide a repository with a minimum reproduction of the issue. |
Thanks @aleclarson! For now, creating a {
"printWidth": 120
} I was also still able to keep my current configuration in my {
"max-line-length": [true, { "limit": 120 }],
} |
@james2406 You can keep |
Tracking this in #25 |
@aleclarson In case I create .prettierrc (workaround for max length)
failing tslint rule for .js files (works in .ts file)
.prettierrc (workaround for workaround)
please help us with consistency across prettier and tslint |
@rambabusaravanan Please open a new issue with the features you'd like to see added. Thanks! 👍 |
When setting tslintIntegration to true, prettier does not take into account its print-width rule anymore, neither it takes the max-line-length rule from tslint for formatting line length. When formatting files, it acts as if the print-width would be 80.
Here is my configuration:
VS config (extract):
tslint.yaml (extract):
common/tslint.yaml (extract):
The text was updated successfully, but these errors were encountered: