-
Notifications
You must be signed in to change notification settings - Fork 889
Whitespace padding in object literals, destructuring assignment, and import statements #1044
Comments
I assume the same style should apply to named imports. |
Any progress? |
+1 |
1 similar comment
+1 |
an option for the same thing for arrays would be great too. |
I prefer it without the spaces, so an option for that would also be nice. |
+1 |
It would also be nice if we could enforce spacing before and after the colon like { foo : 'bar' } //good { foo: 'bar' } //bad { foo:'bar' } //bad |
Any progress on this? I would really like to use this in our projects at Acquia. |
OMG, it still open? |
BTW tslint-eslint-rules supports this in nearly all cases (except object literal types) with the rule |
we use the following to achieve this: {
"extends": [
"tslint-eslint-rules"
],
"rules": {
"object-curly-spacing": true,
"array-bracket-spacing": [
true,
"never"
]
}
} |
Any update on this? :) |
@micheleangioni I'm just using eslint plugin for integration tslint with eslint and that solves my problem linked with this issue |
I tried out Would be great to have something like this in tslint proper! |
I see #4068 added a check for spaces after open braces, but it doesn't detect more than one space, and doesn't deal with closing braces and empty objects. |
Including #3092: if this goes in, it should also add for generics. |
Would be a great thing to have |
There have been very few PRs submitted to address this issue, and it is not a priority for TSLint core (see #4534), so I'm going to close this. If you want to implement this whitespace check, it can happily live in a custom rule set outside this repo. |
I was looking for the solution and a colleague suggested it is already part of TSlint. |
You just need to add below rules in tslint.json file:
|
🤖 Beep boop! 👉 TSLint is deprecated 👈 and you should switch to typescript-eslint! 🤖 🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋 |
Enforce whitespace padding in object literals:
The text was updated successfully, but these errors were encountered: