HNHacker News
TopNewBestAskShowJobs

saranshk

2,158 karma · joined November 10, 2015

submissionscomments
saranshk··on “It’s Easier To Ask Forgiveness Than To Get Permission”
Not always though. The context is important as well.
saranshk··on Using Prettier to format your JavaScript code
Since prettier formats using the javascript AST, it should not introduce any bugs.
saranshk··on Using Prettier to format your JavaScript code
The opinionated formatting is what makes prettier great. A lot of configuration can be confusing for people to go through and pick a standard
saranshk··on Using Prettier to format your JavaScript code
As mentioned in the post, I have set my configuration in VS Code's settings itself.
saranshk··on Using Prettier to format your JavaScript code
Javascript modules were created for this purpose only. Have them as separate files while developing, have it readable and then you can always bundle them in a single file while deploying
saranshk··on Using Prettier to format your JavaScript code
They are working on adding support for more languages
saranshk··on Using Prettier to format your JavaScript code
Prettier docs mention that support for Java is WIP
saranshk··on Using Prettier to format your JavaScript code
If you have 10k LOC in a single file, you have bigger problems to worry about
saranshk··on Using Prettier to format your JavaScript code
https://prettier.io/docs/en/precommit.html This should help you get setup
saranshk··on Using Prettier to format your JavaScript code
Just curious, does VS format files based on max length and break them if it exceeds? I have never seen a setting for that
saranshk··on Using Prettier to format your JavaScript code
None that I know of
saranshk··on Using Prettier to format your JavaScript code
Agreed. Formatted code does not allow you to write stuff that is difficult to understand/reason about
saranshk··on Using Prettier to format your JavaScript code
Formatting per file/directory is a feasible solution. Another approach could be that you integrate it in your editor, and on every file that you work, on pressing save, it gets formatted. Thus you can convert it file by file. If you do it all at once, it would be a big diff and blame will always point to that commit and you would have some problems because of it
saranshk··on Using Prettier to format your JavaScript code
I don't think they will add them. They are very opinionated and skeptical about adding configuration options. If there is more of those, then again everyone will try and have an opinion of their own and it will end up being like ESLint. Also that will lead to a lot of time spent on understanding the configuration file which will be a disadvantage as well since currently prettier just works!
saranshk··on Using Prettier to format your JavaScript code
Thanks! I also have the extension installed in code.
saranshk··on Using Prettier to format your JavaScript code
I remember reading that gofmt was one of the inspirations for prettier
saranshk··on Using Prettier to format your JavaScript code
I think the authors include people from React team and fb open source team has been innovating at scale since some time now
saranshk··on Using Prettier to format your JavaScript code
Yes, TS support was baked in recent versions
saranshk··on Using Prettier to format your JavaScript code
It's great to have reviews that do not involve discussions regarding formatting
saranshk··on Using Prettier to format your JavaScript code
I have kind of stopped indenting my files while editing. I know prettier will do that when I hit save (I have it as an extension in code)
saranshk··on Using Prettier to format your JavaScript code
Totally agreed. The pre-commmit hooks do tend to have a lot of tests and enabling in feature branches will be a pain but these tools are needed in order to have stricter checks and ensuring that people of all experience levels continue working without destroying the code quality
saranshk··on Ask HN: How can I seek out successful mentors who I can connect to?
Totally agreed. Cold emailing can work wonders sometimes. Contrary to our beliefs, many people are willing to reply to emails
← PreviousPage 2 of 2