Masthash

#ESLint

Pelle Wessman
3 days ago

FYI – I’m available for #coaching / #teaching / conference talks / shorter #freelancing gigs (1-2 days at a time)

I’m right now primarily focusing on my own projects but happy to share my experience with others + never wrong to refill the wallet a bit.

Topics I’m extra thrilled about: #TypesInJS #vanillaJS #nodejs #fastify #opensource #npm #eslint #linting #maintainership #restAPI

#openToWork

Markus Tacker
6 days ago

Another day fighting with #eslint. :/

Inautilo
1 week ago

#Development #Explorations
Speeding up the JavaScript ecosystem: Polyfills gone rogue · You wanted a banana and got a jungle https://ilo.im/1599o9

_____
#WebDev #Polyfills #Npm #Dependencies #Eslint #Frontend #JavaScript

Yumeko
2 weeks ago

And as is typical, of course I finally come across the actual solution (well, at least a single working one) after complaining publicly about it. For anyone else wondering: Go to Extensions, search for @builtin, and in the Features section there's one named TypeScript and JavaScript Language Features. Right click -> Disable (for workspace), reload. #eslint #javascript #typescript #vscode

Yumeko
2 weeks ago

What's the fastest way to temporarily disable all JS/TS linting in VSCode? I do not care about lint errors when I'm trying to edit merge conflicts, jesus christ it is annoying how VSC really doesn't make much of a separation between these when browsing files. Frankly disabling linting should be a shortcut toggle button somewhere right down in the status bar #eslint #javascript #typescript #vscode

#TypeScript question.

Can i somehow force other devs to NOT use`===` to compare class instances?

Example:

```
class User {
constructor(private id : number) {}

equals(comparedUser : User) {
return this.id === comparedUser.id;
}
}

const userA = new User(123);
const userB = new User(123);

console.log(userA === userB); // => wrong usage returns false
console.log(userA.equals(userB)); // => correct usage returns true
```

Playground: https://www.typescriptlang.org/play?#code/MYGwhgzhAECqEFMBO0DeAoAkMA9gOwgBckBXYQnJACgAckBLANzEIWnoBNoAuaPEgLYAjZAEo0AX3RYEARxJgQEKrgE0wSBB3jIecREnEZMmTYRJI80QgAt6EAHSdoAXjfRV6zdoNOOAbiwpKXRcAkJoEgMAQVc+BAB3fWQqAEYAJgBmUUCwokiDACE4vETk6gzswND8CBwQBAcQHABzKijkWLcXAuRCnOgAekHXAD5oBKR8FoKwFrYzCwJoADNFRBqCesbmto6kaIc5BSV2otEB4bGPSk1yWfnoRcsYYhIEdCA #ESlint

Rui Nibau (rnb)
2 weeks ago

Pour harmoniser le code de tous mes devs #javascript, j'utilise une seule installation globale de #ESLint (https://eslint.org/) (npm install -g eslint).

Mais les #plugins eslint sont résolus par rapport au fichier de configuration d'eslint.

Pour aussi utiliser les plugins installés globalement, il faut lancer eslint avec l'option --resolve-plugins-relative-to

Config VSCodium:

"eslint.options": {
"resolvePluginsRelativeTo": "/home/<user>/.local/lib/node_modules"
}

Jan :rust: :ferris:
1 month ago

This is mad 🤯

oxc - The Oxidation #Compiler is creating a suite of high-#performance tools for the #JavaScript / #TypeScript language re-written in #Rust - by Boshen:

https://github.com/web-infra-dev/oxc

It's linter is 50 - 100 times faster than #ESLint...

https://github.com/Boshen/bench-javascript-linter

...and its parser is even 2x faster than #swc

https://github.com/Boshen/bench-javascript-parser-written-in-rust

#JS tooling goes brrrrrrrrrrr! 🚀

#RustLang #WebDev #WebDevelopment

Andrew (Nannoo)
1 month ago

Has anyone had success using Tailwind with Astro in VSCode? Turns out the Headwind extension, which I use to sort Tailwind classes on save, doesn't work on Astro files. I spent a couple hours last night trying to setup ESLint/Prettier to get the same functionality but I had a lot of issues. If anyone has a repo they could point to where that is working, please let me know.

#withastro #tailwindcss #eslint #prettier

Guz013
2 months ago

Recently, been building my own #eslint config file and taking the opportunity to try the new flat-config format. And just to make something different and learn something, why not make it just import the needed configs automatically via a CLI?

Also, this way is possible to easily make the configuration have hierarchy lake the .eslintrc format in monorepos

So it could be helpful on repos with different environments, or when having different "presets" of configs that want to use on your projects

You know the situation has got out of hand when you have to extract & publish a package to minimise the overhead of configuring your #JavaScript / #TypeScript projects :farnsworth: .

I'm almost ashamed of publishing this stuff ( https://www.npmjs.com/package/@coderspirit/eslint-config ) to #NPM, but it's too tedious to keep in sync and up to date my #ESLint and Prettierjs across all my projects.

Also: many people fall into cargo-cult practices, they don't even know why their config is like that 🐸

felix
2 months ago

does anyone know how to prevent my attributes from formatting into a single line when saving my vue components?

I long ago lost the battle against prettier/eslint/vscode and just tend to leave it to it but I find this particularly irritating

#vue #nuxt #vscode #prettier #eslint #webdev

a screen recording showing my nicely formatted vue component with attributes on single lines, turned into a long, single line on save :(
Frank Quednau
2 months ago

The #ESLint plugin for exhaustive deps in #react development is quite condescending to mature react developers. Yes, not only the react team is able to provide stable functions you can safely close over. However, the plugin never learned to support a list of functions that are known to be stable.
So we either have to live with no warnings at all (and miss potential issues), or live with a ton of warnings where we visually have to inspect whether the warnings consist of false positives only.

Tiberiu Ichim
3 months ago

To my absolute surprise, #nextjs scaffolded apps don't come with #eslint and/or #prettier working OOTB.

Claudio Zizza 🦜
3 months ago

Well, that's a way to name a coding style rule that prevents == in favor of === instead: "eqeqeq"
#eslint

Markus Tacker
3 months ago

TBH, I am not so happy with our current setup. #Prettier and #ESlint is ok, but not super fast. And the integration in #VSCode is lacking. Right now I am using lint-staged for the heavy lifting, but it would be nice to get warnings when writing code, not when you are trying to commit.

Markus Tacker
3 months ago

Oh hell, there is new work on the horizon. TypeScript #ESLint v6 just came out (https://typescript-eslint.io/blog/announcing-typescript-eslint-v6/), but ESLint 9 not yet, which adds a new config format (https://eslint.org/docs/latest/use/configure/configuration-files-new), and everything is going to be broken when it comes to code style tooling for the next 12 months, I fear.
#JavaScript

Kir Belevich
3 months ago

💻 There is this common (mis)belief about #Prettier alone to be more than enough to enforce a strict and opinionated style guide. And that #ESLint stylistic autofixable rules are mostly redundant and even almost deprecated.

I'd say it's the opposite, and it's absolutely possible to have only ESLint for all the stylistic issues you can imagine (including ruining everything by line length ofc). Not to mention a smart mix of both tools.

Here is one rule I can't live without https://eslint.org/docs/latest/rules/padding-line-between-statements

Kir Belevich
3 months ago

💻 "Format Code Action" VSCode extension is an alternative solution to combined tools such as "VS Code Prettier ESLint":

https://github.com/rohit-gohri/vscode-format-code-action

So that you can compose both #ESLint and #Prettier official extensions manually in whatever way.

Just faced Prettier v3 migration issues train https://github.com/idahogurl/vs-code-prettier-eslint/issues/171https://github.com/prettier/prettier-eslint/pull/901 and decided to go back to the old solid approach.

Today's my first day trying #deno.

Not sure how I feel about the built in #linter and formatter yet; me and #prettier are besties, and I have gotten used to #eslint

Still gonna give it a try.

#webDev #nodejs #node #npm #npmjs #javaScript #programming #code #dependencies

# Miss this week’s newsletter? Get guidance & rec’s on how to address #eslint findings in #SharePointFramework projects 👉 https://www.voitanos.io/blog/navigate-eslint-sharepoint-framework-projects-guidance

#spfx #microsoft365dev

Got a new release candidate for my @eslint config tools. Still debating whether to keep @​eslint/js as a dependency, might move it to peer.

Backwards compatibility is also restored now, so this release candidate should work with existing legacy config setups, including new rules from extending recommended configs from plugin authors :)

#JavaScript #TypeScript #ESLint #CI

https://github.com/foxkit-js/eslint-config-foxkit/releases/tag/v3.0.0-rc1

Learn how to handle #ESLint build-time errors, modify rules, and selectively disable rules in #SPFx projects AND get my rec’s… that’s tomorrow’s newsletter! Subscribe today so it’s in your inbox tomorrow! #microsoft365dev #sharepointframework https://www.voitanos.io/newsletter

kaiserkiwi :kiwibird:
4 months ago

Wenn man #ESLint in einem Projekt einrichtet, nachdem es schon eine Weile existiert. 😅

Komplett vergessen das einzurichten und nun… Offenbar ein paar Flüchtigkeits"fehler" gemacht. :D

Und ja, ich stelle mir selbst bei meinen eigenen Projekten Pull Requests und reviewe sie.

#Coding #JavaScript

Screenshot der GitHub-Grafik, welche anzeigt, wie viele Zeilen Code verändert wurden.

4.311 Zeilen wurden verändert bzw. hinzugefügt.
1,844 Zeilen wurden entfernt.
Fynn Becker
4 months ago

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

#ESLint #Prettier

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

Pelle Wessman
4 months 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
4 months 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
4 months 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

leo faria
5 months 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

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.

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.
5 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
6 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 💖
7 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
7 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
7 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
7 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
8 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
8 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
8 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
Aboobacker MK
9 months ago

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

#javascript #performance

danrot
10 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.

@CodingItWrong I have one project that uses #ESlint for formatting with autofix, but it means my editor highlights minor formatting issues as errors. This is very distracting, and I regret setting up this project like that.

I guess I could change it so formatting issues are not listed as errors, but I might as well just switch to prettier then.

Several lines of JSX code, all the lines are highlighted red. Warnings are overlayed next to each line with messages like "Expected indentation of 6 spaces but found 4."

@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