Live data from Hacker News

ESLint 7.0

eslint.org

41–50 of 93 posts

Re: ESLint 7.0

#41

Ah ESLint, the most necessary bane of my existence. Good work to the team for the update.

I just could not deal with such an opinionated tool. ESLint would not let us adjust settings to accept some of our normal convection's and company code style guidelines. I switched to jshint and have lived a much happier life.

I feel this way but about `prettier.js` (as opposed to eslint.js) instead.

Re: ESLint 7.0

#42
post #7

There is a rule in eslint that warns you when a promise is dangling and hasn't been handled. Please use that rule . So many bugs in the JS world is because of dangling promises.

Please don't use uppercase for emphasis. If you want to emphasize a word or phrase, put asterisks around it and it will get italicized.

https://news.ycombinator.com/newsguidelines.html.

Re: ESLint 7.0

#43
post #31

Earlier quoted context omitted.

But until recently an unhandled promise failure was NOT a thrown error, and when it is it's not the error you want.

There is a saying - what you don't know can't hurt you. The idea of Promises comes from strongly typed static functional languages. Adding it to JavaScript was a terrible idea. Like with static modules - forcing the user to download the whole website/app before anything is rendered on the screen.

Lol what are you on about.

You're mixing so many different things right now.

Re: ESLint 7.0

#44
post #39

Earlier quoted context omitted.

And if you are working in a team it makes those arguments about styling moot. One of the best aspects of JavaScript.

Yeah that’s what I mean about PRs - such a time saver to not discuss trivial code style issues and be able to just focus on the code itself!

I'll never forget getting our team of 90+ devs to move to prettier because of this argument and then having team members proceed to strong arm me to change the configs to things that they preferred six months after we made the move and we had adopted it across over 10 different repos. Talk about counter to the whole point of using such a wonderful tool.

Re: ESLint 7.0

#45
post #3

I didn't like programming in JavaScript so much because I think the syntax makes it a little harder to read than necessary. However, I confess that after adopting ESLint in my workflow, things have improved considerably. I can ask it to warn me on unused stuff, to enforce the lack of semicolons, to format and indent my code correctly on save... it's a very useful tool. If you have something against JavaScript in gene…

You can do most of that without ESLint for any programming language with an IDE. Speaking about jetbrains intellij/pycharm from my own experience.

The IDEs will sometimes use their in-house solution, and sometimes integrate one of these external tools that focus on doing just one thing very well. My setup is VSCode + ESLint when dealing with JavaScript.

Re: ESLint 7.0

#46

Earlier quoted context omitted.

I just could not deal with such an opinionated tool. ESLint would not let us adjust settings to accept some of our normal convection's and company code style guidelines. I switched to jshint and have lived a much happier life.

I feel this way but about `prettier.js` (as opposed to eslint.js) instead.

That's expected - Prettier intentionally and openly positions themselves at the most extreme extreme end of convention-over-configuration. Their tagline is "Opinionated code formatter". If this bothers you, you should look for a different tool.

Re: ESLint 7.0

#47
post #42
post #7

There is a rule in eslint that warns you when a promise is dangling and hasn't been handled. Please use that rule . So many bugs in the JS world is because of dangling promises.

Please don't use uppercase for emphasis. If you want to emphasize a word or phrase, put asterisks around it and it will get italicized. https://news.ycombinator.com/newsguidelines.html .

HNLint

Re: ESLint 7.0

#48

Earlier quoted context omitted.

I think that's part of the typescript plugin, not part of eslint core - https://github.com/typescript-eslint/typescript-eslint/blob/... (I assume that means it only works on TypeScript.) But, I agree with your point, that rule can catch a lot of bugs.

There are many ways to get this rule, but the primary one being: https://www.npmjs.com/package/eslint-plugin-promise

I don't think that plugin catches floating promises, i.e. promises that are not waited (either via await or then/catch method). The rules listed in that package's readme don't seem to mention it at least (unless I'm totally misreading something). You kinda need TypeScript for that because you need the type info to know if a value whether some value is a Promsie to give the warning.

Re: ESLint 7.0

#49
post #8
post #7

There is a rule in eslint that warns you when a promise is dangling and hasn't been handled. Please use that rule . So many bugs in the JS world is because of dangling promises.

hundreds of rules to read, is this on its recommended list if it's so critical? is its name 'no-floating-promises'?

>is this on its recommended list

Not now, but it's planned to be starting with the next major version. They are holding off until then since changing the default rules is considered a breaking change.

https://github.com/typescript-eslint/typescript-eslint/issue...

Post reply on HN