You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add autofixing of lint warnings for specific packages/files
Currently, there are a ton of lint warnings, and it would be good to
address them sooner rather than later.
The good thing is that many of these warnings can be autofixed — if they
are turned into errors first. So, what we _could_ do is open
`eslint.config.mjs`, change all of the rules that are configured to
produce warnings to produce errors instead (`"warn"` -> `"error"`), then
run `yarn lint:eslint --fix` and take care of them in one fell swoop.
However, if we took this approach, approving such a PR would likely take
a while since the changes would touch a bunch of packages in this
monorepo and require codeowner approval from a bunch of teams.
Instead, it would be better if we batched lint violation fixes by
codeowner. That is, open PRs progressively by addressing all lint
violations for packages owned by the Wallet Framework team first, then
the Accounts team, then the Confirmations team, etc.
To do this, we would need a way to run ESLint on specific directories.
Again, that seems easy on its own, but we'd have to repeat the step that
modifies `eslint.config.mjs` to change warning-producing rules to
produce errors instead each time we wanted to make a new PR.
Instead, if would be better if we could ask our ESLint script to not
only allow custom file paths to be passed in, but also convert warnings
into errors for us.
That's what this PR does. For instance, you could say:
```
yarn lint:eslint packages/network-controller --treat-warnings-as-errors --fix
```
and now ESLint will run just on `network-controller` files, and autofix
any warnings automatically.
0 commit comments