Closed Bug 1807711 Opened 2 years ago Closed 7 months ago

make `mach format` run JS formatters

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1949576

People

(Reporter: sheehan, Unassigned)

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)

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?

Flags: needinfo?(sheehan)
See Also: → 1954750

(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 format will now run prettier (without also trying to run all of eslint --fix). :sheehan, can you confirm that's right?

Yes, this looks correct to me! I will proceed with bug 1807712 later this week. :)

Status: NEW → RESOLVED
Closed: 7 months ago
Duplicate of bug: 1949576
Flags: needinfo?(sheehan)
Resolution: --- → DUPLICATE
No longer blocks: 1807712
No longer depends on: 1809497
See Also: 1803229
See Also: 1954750
You need to log in before you can comment on or make changes to this bug.