-
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
94 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters