Masthash

#eslint

Fynn Becker
3 days ago

Good explanation of the differences between a linter and a formatter.

#ESLint #Prettier

https://www.youtube.com/watch?v=Cd-gBxzcsdA

Pelle Wessman
1 week ago

@mvsde I’ll probably go with #dprint instead of #prettier if I go beyond what #eslint still supports stylistically.

dprint feels as un-opinionated and configurable as ESLint whereas Prettier is quite opinionated.

Looked at it? https://dprint.dev/

Pelle Wessman
1 week ago

Also check out my personal extended #StandardJS configuration for @eslint (targeted at #TypesInJS projects): https://github.com/voxpelli/eslint-config

Feel free to use it or to be inspired by it for your own #ESLint configs.

Pelle Wessman
1 week ago

Stepped in these last few days and did some long overdue releases of #StandardJS despite having lots of else on my plate currently.

New releases of:

- https://github.com/standard/standard-engine/releases/tag/v15.1.0 (First in three quarters!)
- https://github.com/standard/eslint-config-standard/releases/tag/v17.1.0 (First in a year!)
- https://github.com/standard/standard/releases/tag/v17.1.0 (First in a year!)
- https://github.com/standard/semistandard/releases/tag/v17.0.0 (First 17.x release, first release in almost 2 years!)

If you like what I do, consider sponsoring me: https://github.com/sponsors/voxpelli

#npm #npmRelease #linting #eslint

eslint config is ready #ESLint 9 now :)

Got a lot of changes, mainly that configs now come as a configure() function. #Preact and the jsx runtime are now simple boolean options, my opinionated strict rules are now optional (for the most part) and I documented a workaround for __dirname in esm configs in the #TypeScript section of the README

https://github.com/foxkit-js/eslint-config-foxkit

funfact: the moment I switched to the new #ESLint config I published earlier today I found a bug where I had [object Object] in some urls:

Screenshot of a linked icon with a url that incorrectly ends in [object Object]

Quickly backported my new ts-strict ruleset for @eslint from the 3.0 rewrite:

https://www.npmjs.com/package/eslint-config-foxkit

{
extends: ["eslint:recommended", "foxkit", "foxkit/ts-strict"]
}

#webdev #TypeScript #ESLint

leo faria
1 month ago

New post: ESLint fan? Curious about ESLint? I wrote a post about it with the best of the tool:

https://leonardofaria.net/2023/04/30/the-best-of-eslint

#newpost #javascript #eslint

Braw :blob_cat_melt:
1 month ago

To make #TypeScript ensure you're writing safe code, you need to properly configure it, but proper configuration is really messy, and tools like #ESLint don't even support it. So you are left with the single TSConfig that makes TypeScript lie and deceive you.

This is the state of modern #JavaScript development experience.

Michael Houmann
1 month ago

Still working on my #reactjs project. Had some problems with #eslint that took a good bit of time, but did find time to finish the 404 page.
You can find the code on #github
https://github.com/mhoumann87/birthday-reminder

#WebDevelopment #javascript #HTML #CSS

Also #react mit #bootstrap und #typescript ist ja schon klasse fürs #Frontend, wenn man es denn mal so hinbekommt, dass es das macht was man will - mit dem #javascript wie ich es kenne, hat das aber überhaupt nichts mehr zu tun:
Allein den Editor #VScodium so zu trimmen, dass #prettier und #eslint mit den Konfigs in #react zusammenarbeiten war echt nervtötend.
Für das Backend mit #python #cgi wird das nicht so nervenaufreibend werden, hoffe ich...

Harry W.
2 months ago

I've got such a weird problem; it looks like #eslint is running in it's own thread. So when running `yarn lint` it finishes, then 5 seconds later it takes over the console again with the actual output. This is causing havoc!
Any ideas? #JavaScript #JS #Code

Chris Minnick
2 months ago

My latest (and greatest) book, JavaScript All-in-One For Dummies, is available now!

Every junior developer or aspiring JS developer needs this book, imho.

The book teaches modern #JavaScript, how browsers work, using #VSCode like a pro, #Git, #prettier, #eslint, #vite, #webpack, #react, #vue, #svelte, #http, #jest, #node, #express, #mongodb, #mongoose, and finishes with a chapter on authentication with #jwt.

It took me 6 months to write and is over 800 pages.

https://amzn.to/3GIMRGX

Everyone wants to add tools to the dev env, but nobody wants to support their team when they break the precommit hooks. #eslint #typescript #jest #tdd #danger #testCoverage #linting #husky

Josh Goldberg 💖
3 months ago

I'm going to be at 🌴 React Miami 2023 this April, talking about some of my favorite stuff in code - setting up ESLint and TypeScript for React! Hope to see you there! ☺️

✨ www.reactmiami.com ✨

#eslint #react #typescript

Promo photo with my face, flowers, leaves, and "Goldberg" in text with a pink shine. React Miami, April 20 - 21, www.reactmiami.com
Chris Minnick
3 months ago

I just finished the final review of my new book (coming in May): JavaScript All-In-One For Dummies. This one has been my dream to write for over a decade, and I've been working on it for 10 months.

When I used to hire junior developers, I'd find myself (and them) overwhelmed with how much they had to know to be to be productive. This book addresses that.

#JavaScript #Git #vscode #React #Vue #Svelte #ESLint #Jest #Node #webapi #express #mongodb #webpack #babel #vite #rest #jwt #micdrop

intrnl
3 months ago

has anyone ever used #ESLint together with #dprint?

what's the best way to use them together? I suppose I should use dprint-plugin-exec for ESLint to do the fixable style rules?

Fynn Becker
4 months ago

#Stylelint deprecated all stylistic rules and #ESLint is also kinda moving in that direction.

Maybe it’s finally time to take a look at #Prettier? 🤔

But I definitely have to configure it so code stays readable and doesn’t become this mess of seemingly random line breaks.

Ever looked at what Prettier does to JS template literals? It’s certainly something 😬

https://stylelint.io/migration-guide/to-15

Paul Denya
4 months ago

#ESLint and #prettier need a "analyze my existing project and choose the least disruptive settings" plugin

@hazel @rick I am a bit relieved that #eslint team has done this.

There was always a tug of war between eslint & #prettier and most places use both.

Eslint to me is more about catching errors at compile time.

I am not a fan of prettier but what other choices do we have ?
🤷🏽‍♀️

Hazelnoot
4 months ago

Just learned that #ESLint has deprecated all style and formatting rules. Are there any other good code formatters for #JavaScript / #TypeScript? I know #Prettier is quite common, but its way too opinionated for my tastes.
#Coding #Dev #Programming #WebDevelopment #SoftwareDevelopment

Serhii Kulykov
4 months ago

Some secrets from the #Vaadin R&D weekly update. Our #designsystem team has been working on really cool stuff lately, including #buildWithLit experiments! Also, do check out eslint-config-vaadin alpha, it's a great #eslint config:

https://github.com/vaadin/eslint-config-vaadin

weekly update summary that mentions eslint-config-vaadin, plus a comment about Lit conversion experiments
Ben 🌹 :NERevs:
4 months ago

#react / #preact devs: does the #eslint "exhaustive deps" rule make sense for useEffect? It doesn't seem like it does, to me. useEffect says "when these dependencies change, run this callback" and by nature of *any* dependency changing, the callback will be reinitialized, so it's not like if I only want it to run on X changing, but I reference Y, Y would be stale… right? Y in the new callback would still be up-to-date, wouldn't it?

Ryan Atkinson
5 months ago

published a repo with setup instructions and resources for my dev environment: https://github.com/ryanatkn/setup

I do web dev in Ubuntu/Debian (both standalone and with Windows via WSL) and the bash setup script depends on `apt`

includes #NodeJS #svelte #ESLint #prettier #VSCode #postgres #FishShell and my own toolkit #gro

it's like a `dotfiles` repo but with more things and better docs

Aboobacker MK
5 months ago

Is there any #eslint plugin available for checking common performance issues in javascript?, especially when dealing with DOM.

#javascript #performance

Marc Huffnagle
5 months ago

An article I just wrote on the dangers of writing in JavaScript and how to avoid (some of) them:

https://marc.huffnagle.net/2022/12/31/developer-beware.html

#TypeScript #JavaScript #ESLint #programming

Marc
5 months ago

An article I just wrote on the dangers of writing in JavaScript and how to avoid (some of) them:

https://marc.huffnagle.net/2022/12/31/developer-beware.html

#JavaScript #TypeScript #ESLint #programming

6 months ago

Is it just me or is developer tooling in #react superior to #vue? It seems to me that tools like #eslint and #typescript are less likely to work correctly in vue templates or at least require additional configuration that needs to be maintained additionally.

Marc
6 months ago

Adding ESLint to an existing project, or modifying your rules, can result in a lot of errors being reported. It isn't always reasonable to fix them all at once, though.

To help with that, I've created an npm package called eslint-ratchet. It tracks the number of ESLint errors being reported in your code and prevents it from going up. When the number of errors goes down, it "ratchets down" and that new lower number is the new limit.

https://www.npmjs.com/package/eslint-ratchet

#ESLint #JavaScript #TypeScript

ehmicky
6 months ago

Interesting name for this TypeScript ESLint rule option.

#eslint #typescript #ts #linting #javascript #js

Rule named `allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing`.

@CodingItWrong #eslint is for logical code errors.

For example reactjs has some warnings, for syntactically correct code but logical errors, eslint has special rules for this.
#prettier simply formats code

Isaac Su
6 months ago

@CodingItWrong Some pointers that helped me:

- Formatting and linting are two distinct operations with two distinct goals.

- #Prettier is firstly a set of well-regarded code-format opinions that happens to come with a formatting tool.

- #ESLint is a general purpose code linter that can also do formatting.

To do both, you can either run it as two separate CLI commands, or just run the one eslint command configured with the prettier ruleset. The outcome should be the same.

Josh Goldberg 💖
6 months ago

I like this feature request in eslint-plugin-expect-type from @rauschma - would love to see folks chime in on the exact semantics!

#eslint #typescript #typescript-eslint

https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/issues/65

Thomas Randolph :thomas:
6 months ago

Reading the #eslint complete rewrite discussion on GitHub and there are just reams upon reams of Typescript users moaning about how complicated Typescript makes everything.

Just page after page after page of "Typescript is so fucking complicated to use; my life is basically consumed by Typescript." and then they punctuate it with "and you need to make it easier for me by making your thing Typescript, too."

The call is coming from inside the house, fellas (it's always fellas).

I use :vim:
6 months ago

Has anyone else been getting frequent #memoryleak #errors with the #webpack #cli recently? I’m on version 4.10.0 of the CLI and 5.21.2 of webpack. I get them about three times a day at work when I’m making changes and using #HotReloading. I’m not sure what’s causing the leak (webpack, the CLI, or maybe #eslint?) but it’s really #annoying

katerberg
6 months ago

Published my first #npm #ESLint package. I’ve contributed to ESLint before, but never actually published my own package.

It was not bad at all. It took about 2 hours.

The rule is really simple and not useful to most people, but it was a nice way to ensure that we don’t forget to add #a11y #axe #jest tests to our test files and I can imagine it being useful for other similar code-hygiene patterns some day: https://github.com/katerberg/eslint-plugin-file-contains

Roma Komarov
6 months ago

There should be versions of `eslint-disable`, `stylelint-disable` (-line etc) that would instead of removing the errors & warnings, reduce the severity: removing the warnings, and making errors into warnings.

This way it would be possible to mark something be safe to pass the CI, but keep the visible warning.

Otherwise, we basically need to make a separate rule that targets the disabling comment for a specific rule and gives a warning for it, which is a bit meta.

#frontend #eslint #stylelint

Ian VS
6 months ago

@randName I saw recently that #ESLint is considering using #JSDoc to generate types. https://github.com/eslint/eslint/discussions/16557

I'm curious, what has your experience been like using that approach? It sounds like you've been forced to fall back to writing actual type definitions. Are you in a monorepo setup, which is why you mention them being installed in node_modules?

I use :vim:
6 months ago

@elijahmanor I’m in the market for this as well. At work, our code bases each have their own configuration, some of which have questionable rules enabled (ie: non-indented switch statements). I’ve taken the task to standardize our #javascript styling rules and create a standard configuration. With this, I’ll need to fix all the errors that #ESLint will complain about.

Jan :rust: :ferris:
6 months ago

@rust_discussions "In the follow up discussion we can learn more about the idea for the new linter[...] by using abstract syntax tree (AST) to understand the code structure and organize it nicely."

How else would someone lint code if not with an #AST? What algorithm/data structure does #ESLint use currently?

#Compiler #Linter #Parser #AbstractSyntaxTree

Ian VS
6 months ago

Interesting. #ESLint is considering a full rewrite, maybe with parts of it in #RustLang, and likely not using #TypeScript, but rather JS + JSDoc. There's also a proposal here to expand from single-file linting to exposing a global "session" context to parsers and rules.

Definitely some good discussion going on here, and I'm excited to see what comes of it.

https://github.com/eslint/eslint/discussions/16557

@nzakas +1 for using jsdoc types. this would be an excellent example to the community of the pattern!
#typescript #eslint

Nick Taylor
7 months ago

Looking forward to hanging with Josh Goldberg again on the my Twitch stream next week! We’ll be discussing ASTs, ESLint, and TypeScript ESLint and hopefully get a bit of live coding in as well.

Come hang with us Wednesday, November 23rd at 4:30 pm UTC! (Not the usual 5 pm UTC)

https://iamdeveloper.live/schedule?segmentID=9fe8e9bc-9cfe-4264-8b6b-088a3c95b355 #typescript #eslint

Fynn Becker
7 months ago

Finally got around to update my #ESLint config with some nice bits I picked up in the last 12 months:

* Tabs for indentation
* Trailing commas
* Consistent array new lines
* Import sorting

https://github.com/pangolinjs/eslint-config/releases/tag/v7.0.0

Ian VS
7 months ago

@mrmaverick That's great. Open source is an excellent way to level up and learn from really smart people. That's how I got my start in software development when @nzakas gave me an opportunity to help out with #eslint way back in the day. Not only did I learn about the #javascript AST and best-practices, but also how to work in a team on a software project. It was invaluable. Best of luck on your journey, and have fun!