this post was submitted on 14 Aug 2023
1370 points (97.9% liked)

Programmer Humor

19817 readers
1398 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 1 year ago* (last edited 1 year ago) (14 children)

Isn't it the same with ESLint 6 (JavaScript/ES6)?

[–] IUsedTo 1 points 1 year ago (1 children)
[–] [email protected] 6 points 1 year ago* (last edited 1 year ago) (1 children)

Are you sure?

(this is my work pc so wayyy to much work to make a screenshot and upload it)

[–] peterj74 7 points 1 year ago (2 children)

That's from ESLint, not javascript itself. JS doesn't care about unused variables

[–] [email protected] 3 points 1 year ago

JS simply does not care.

[–] [email protected] 0 points 1 year ago* (last edited 1 year ago) (1 children)
[–] Exusgu 8 points 1 year ago (1 children)

ESLint won't prevent you from running your code, which is what the OP is on about. Hence the confusion in this thread.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Oh it will. At least in combination with Vue. At least that's the default. Of cause you can disable it.

[–] killeronthecorner 4 points 1 year ago (1 children)

You're describing many things that are not JavaScript the language. If you create and use tools that will stop you then yes they will stop you.

[–] [email protected] -1 points 1 year ago* (last edited 1 year ago) (2 children)

I said ESLint. Not Javascript. ESLint is a linter for JavaScript. That's why I put JavaScript in brackets. Some people don't know what ESLint is. I'm talking about ESLint the whole time. Its not JavaScript specific but it's mostly used for JavaScript

You yourself are talking about ESLint. You said that ESLint won't prevent me from creating unused variables and functions when it clearly does. It won't even run and throw an error

Edit: ohh it's a Lemmy bug. The comment didn't update yet. Originally I said "ES6" then I changed it to "JavaScript" and then I changed it to "ESLint (JavaScript)"

[–] killeronthecorner 3 points 1 year ago

Just saw your edit, and yeah, that makes sense as to the confusion.

Either way, your comment enquired as to whether it was "the same" and it still isn't because for Go it's a language feature and ESLint is not a language, it just allows you to create similar behaviour for JavaSvript which, by default, does not exhibit that behaviour.

[–] [email protected] 3 points 1 year ago

There's a load of confusion in this thread.

What the post is about is compiler based clean code enforcement. JS doesn't do this, but your editor in combination with ESLint prevents you from running the program. However this isn't a general JS thing, just the way your setup works.

load more comments (12 replies)