HomePhabricator

[monorepo] eslint all the js with a single version-pinned flat config

Description

[monorepo] eslint all the js with a single version-pinned flat config

Summary:
All of the js sub-repos in the monorepo have their own lint settings. For eslint before 9, this was best practice. It is difficult to find a "one size fits all" lint approach for JS, since nodejs has different rules from vanilla js, react has its own special rules, the browser has different globals vs node, different test engines also have different globals, different standards have different syntax, some repos have a good reason to use multiple standards, etc.

We want all js to be linted. And we want there to be a maintainable and as-standardized-as-possible approach.

With eslint 9, the "flat config" is introduced which allows a single config file to handle various rulesets across a monorepo. We implement this approach here, deleting all legacy lint settings (many of which were never implemented in arc lint).

We correct all lint issues discovered by this implementation now that arc lint is picking everything up.

Test Plan:
CI for all lint changes

arc lint --everything brings up unrelated py and c++ changes that are not easy to back out of this diff and probably related to my local linter settings. Test plan for JS-only impacts.

arc lint -- cashtab/*
arc lint -- modules/**/*
arc lint -- apps/**/*
arc lint -- web/**/*

Reviewers: #bitcoin_abc, emack, Fabien

Reviewed By: #bitcoin_abc, emack, Fabien

Subscribers: Fabien, emack

Differential Revision: https://reviews.bitcoinabc.org/D17755

Details

Provenance
bytesofmanAuthored on Wed, Mar 5, 18:27
bytesofmanPushed on Sat, Mar 8, 05:16
Reviewer
Restricted Project
Differential Revision
D17755: [monorepo] eslint all the js with a single version-pinned flat config
Parents
rABCa5323bdbebad: [e.cash] Updated high quality Pay2Stay Logo for use-ecash page
Branches
Unknown
Tags
Unknown