Open Bug 1807711 Opened 2 years ago Updated 1 years ago

make `mach format` run JS formatters

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: sheehan, Unassigned)

References

(Blocks 1 open bug)

Details

mach format currently runs a few different formatting-only linters. We should add JS formatting to mach format.

Blocks: 1807712

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?

(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 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?

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.

Depends on: 1809497

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.

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.

Flags: needinfo?(sheehan)

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.

Flags: needinfo?(sheehan)
You need to log in before you can comment on or make changes to this bug.