Single Quote and trailing comma rules conflict with tslint
See original GitHub issueRelated to #206
Project settings:
- tslint config has rule defined to wrap strings in single quotes and trailing comma enabled.
- This is my vscode user settings
{
"tslint.autoFixOnSave": true,
"editor.formatOnSave": true
}
- This is my prettier config:
export default {
useTabs: false,
printWidth: 80,
tabWidth: 2,
singleQuote: true,
trailingComma: "all"
};
Issue:
- Saving the files toggle between double quotes and single quotes.
- Same for trailing comma also, saving once adds trailing comma, saving again removes it.
- If I remove the prettier config file and set the below configs in vscode user setting, then it works fine.
{
"tslint.autoFixOnSave": true,
"editor.formatOnSave": true,
"prettier.singleQuote": true,
"prettier.trailingComma": "all"
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
trailing-comma - Rule
Rule : trailing-comma Requires or disallows trailing commas in array and object literals, destructuring assignments, function typings, named imports and exports ...
Read more >Why does prettier put the trailing comma on its own and give ...
"trailingComma": "es5" says that the trailing comma is invalid after the last property. "airbnb-base" might contain a rule which conflicts with ...
Read more >comma-dangle - ESLint - Pluggable JavaScript Linter
Trailing commas simplify adding and removing items to objects and arrays, since only the lines you are modifying must be touched. Another argument...
Read more >How to Configure ESLint and Prettier in an Angular Application
In this last part, we will talk about how to migrate from TSLint to ... that disable some ESLint rules to avoid conflicts...
Read more >How to configure Prettier and VSCode - Gleb Bahmutov
Single quotes, no semi-colons, trailing commas. ... and some of these rules are stylistic, and can conflict with Prettier's style.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same problem, it seems like tslint fails to find the .prettierrc file.
explicitly telling it where it is in tslint.json worked:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.