Live data from Hacker News

ESLint 7.0

eslint.org

51–60 of 93 posts

Re: ESLint 7.0

#51
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…

I also recommend `prettier`. It can be configured to obey eslint and will reformat your code on the fly to fit standards so you can spend less time fighting spacing and more time just writing code. While `eslint --fix` is a thing, prettier parses the underlying AST to do it's transformations and it's a very impressive tool.

yeah, I pretty much rely on eslint and prettier across the board... I do have a couple tweaks though[1].

1. https://gist.github.com/tracker1/e6c2befae41856da27973cf22cf...

Re: ESLint 7.0

#52
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 .

Thanks!

HN should automatically detect this and let me know :D

Unfortunately I think the comment is too old to edit.

Re: ESLint 7.0

#53
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…

> to enforce the lack of semicolons

Why would... you want that? You're trading minimal syntactic noise for possible ambiguity errors. You don't really gain anything.

Re: ESLint 7.0

#54
post #53
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…

> to enforce the lack of semicolons Why would... you want that? You're trading minimal syntactic noise for possible ambiguity errors. You don't really gain anything.

In combination with other linting rules to catch reckless conditionals and multiline returns, it is absolutely safe to enforce no semicolons. And the visual noise is, at least to my eyes, a significant impact.

Re: ESLint 7.0

#55
post #52
post #42

Earlier quoted context omitted.

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 .

Thanks! HN should automatically detect this and let me know :D Unfortunately I think the comment is too old to edit.

> HN should automatically detect this and let me know

That's on the list!

I've reopened the comment for editing if you still want to.

Re: ESLint 7.0

#56
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…

TypeScript.

Re: ESLint 7.0

#57
post #55
post #52

Earlier quoted context omitted.

Thanks! HN should automatically detect this and let me know :D Unfortunately I think the comment is too old to edit.

> HN should automatically detect this and let me know That's on the list! I've reopened the comment for editing if you still want to.

Done! Thanks :)

Re: ESLint 7.0

#58
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'?

I also highly recommend just reading all the rules if you're a JS/TS developer. It really helps you see what stuff could be very useful.

Re: ESLint 7.0

#59

Earlier quoted context omitted.

I also recommend `prettier`. It can be configured to obey eslint and will reformat your code on the fly to fit standards so you can spend less time fighting spacing and more time just writing code. While `eslint --fix` is a thing, prettier parses the underlying AST to do it's transformations and it's a very impressive tool.

yeah, I pretty much rely on eslint and prettier across the board... I do have a couple tweaks though[1]. 1. https://gist.github.com/tracker1/e6c2befae41856da27973cf22cf...

And editorconfig

Re: ESLint 7.0

#60
post #53
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…

> to enforce the lack of semicolons Why would... you want that? You're trading minimal syntactic noise for possible ambiguity errors. You don't really gain anything.

I used always have semi-colons too, but now that my code is always transpiled, I just let the transpiler handle it (and TypeScript does a good job catching ambiguities/unintended code pretty well too).
Post reply on HN