make `mach format` run JS formatters
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Tracking
(Not tracked)
People
(Reporter: sheehan, Unassigned)
Details
mach format currently runs a few different formatting-only linters. We should add JS formatting to mach format.
Comment 1•2 years ago
|
||
I have a concern with a separate command - how do we make this easy for developers? Currently they run ./mach lint and that's it.
If these are separated out, then they'll need to run ./mach lint and then ./mach format. That's now two commands and the order is important. I agree that we need to run format only for lando, but I think we need to consider the developer experience here as well.
Maybe we could keep ./mach lint doing both - it runs the existing linter, than runs ./mach format automatically for the developer?
| Reporter | ||
Comment 2•2 years ago
|
||
(In reply to Mark Banner (:standard8) (afk until 3rd Jan) from comment #1)
I have a concern with a separate command - how do we make this easy for developers? Currently they run
./mach lintand that's it.If these are separated out, then they'll need to run
./mach lintand then./mach format. That's now two commands and the order is important. I agree that we need to run format only for lando, but I think we need to consider the developer experience here as well.Maybe we could keep
./mach lintdoing both - it runs the existing linter, than runs./mach formatautomatically for the developer?
As I understand it the plan for mach format is to continue aliasing mach lint --fix but only for a subset of linters, specifically linters that are formatting-only. So this bug would essentially add the JS formatters to that subset here.
Comment 3•2 years ago
|
||
With bug 1809497 landing, this might now be possible if we're able to pass an option to the ESLint part of ./mach lint which would turn off the ESLint part.
Comment 4•2 years ago
|
||
Would anyone be able to work on this?
I think this we need to add an option adding to ./mach lint --fix so that for -l eslint only the formatting (Prettier) part is run here.
That would then unblock bug 1807712.
Updated•2 years ago
|
| Reporter | ||
Comment 5•2 years ago
|
||
I don't have the cycles to work on this right now, but I could try and take a look at it again in Q3.
Comment 6•7 months ago
|
||
I wasn't aware this bug was on file and filed it separately - I believe I fixed this in bug 1949576 - mach format will now run prettier (without also trying to run all of eslint --fix). :sheehan, can you confirm that's right?
| Reporter | ||
Comment 7•7 months ago
|
||
(In reply to :Gijs (he/him) from comment #6)
I wasn't aware this bug was on file and filed it separately - I believe I fixed this in bug 1949576 -
mach formatwill now run prettier (without also trying to run all ofeslint --fix). :sheehan, can you confirm that's right?
Yes, this looks correct to me! I will proceed with bug 1807712 later this week. :)
Description
•