zowe / zowe-cli

Zowe CLI
Eclipse Public License 2.0
114 stars 86 forks source link

Proposal: Disallow trailing-comma #605

Closed zFernand0 closed 3 years ago

zFernand0 commented 4 years ago

https://github.com/zowe/zowe-cli/blob/537be14f5c19068dba491f5f7763d231e328ae86/tslint.json#L9

Change from false to

"trailing-comma": [true, {"multiline": "never", "singleline": "never"}],

And fixing current linting problems

Pranay154 commented 4 years ago

Hey @zFernand0, i tried making this change on my local branch, and I get loads of trailing comma errors when I run npm run lint. Would you want me to fix these Unnecessary trailing comma's?

zFernand0 commented 4 years ago

Hey @Pranay154, Thanks for looking at this. Nobody opposed for more than 3 months, so I say we are good to go. If you have the time, please feel free to open a PR. Thanks a lot! 😄

dkelosky commented 4 years ago

I've been out of Zowe CLI development for a few months, but I'd propose to allow dangling commas when we migrate to ESLint. Maybe I'm the only one to develop this way, but I move lists around a lot (Alt + arrows) and replicate a lot (Ctrl + C & V).

I like the feature of JavaScript which would error in C or Java. I recognize this partially subjective but 1.8k claps can't be too wrong 😄

VitGottwald commented 4 years ago

I think we should get linters out of the formatting business and use prettier. That will provide clear separation of responsibilities and avoid problems with formatting.

VitGottwald commented 4 years ago

@dkelosky I completely agree with Nick, he summarised the argument nicely.

VitGottwald commented 4 years ago

I am not sure about the level people are familiar with how the javascript/typescript tooling works under the hood, why prettier is such a revolutionary thing and why ESLint stood the test of time. I did a talk about this topic at a javascript conference in Prague. I would be happy to discuss this topic and/or prepare a shorter session for the group about it in case there was an interest.

Pranay154 commented 4 years ago

I think we should get linters out of the formatting business and use prettier. That will provide clear separation of responsibilities and avoid problems with formatting.

@VitGottwald I used prettier quite recently for a javascript project, and I certainly agree that it provides a nice and consistent way of formatting that is easy to follow, so I would definitely get behind using it. I think it would be beneficial if you could prepare a session to demonstrate its capability to the group so that we can make an informed decision 😄 . Here is an article I was reading as to why prettier is useful: https://medium.com/front-end-field-guide/why-prettier-will-make-you-a-more-productive-programmer-1dcc0e5343cb

The great thing about Prettier is it can be integrated into existing workflows, it can even work alongside of ESLint.