Closed Bug 1626275 Opened 5 years ago Closed 2 years ago

Formatting html files with prettier fails to insert spaces correctly

Categories

(Developer Infrastructure :: Lint and Formatting, task, P2)

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: standard8, Unassigned)

References

(Blocks 1 open bug)

Details

I've just been experimenting with formatting of html files with Prettier.

There seems to be a lot of cases where we're not completing formatting for some reason, e.g.

$ ./mach eslint --fix widget/tests/test_secure_input.html
/Users/mark/dev/gecko/widget/tests/test_secure_input.html
   52:3  error  Insert `··`  prettier/prettier (eslint)
   63:3  error  Insert `··`  prettier/prettier (eslint)
   79:3  error  Insert `··`  prettier/prettier (eslint)
   85:3  error  Insert `··`  prettier/prettier (eslint)
   91:3  error  Insert `··`  prettier/prettier (eslint)
  124:3  error  Insert `··`  prettier/prettier (eslint)
  180:3  error  Insert `··`  prettier/prettier (eslint)

✖ 7 problems (7 errors, 0 warnings)

I'm not sure if this is prettier or eslint-plugin-html causing the issue. It doesn't seem to be the babel parser, as when I comment that out in the top level .eslintrc.js the error still happens.

I've just raised https://github.com/BenoitZugmeyer/eslint-plugin-html/issues/131 about this.

Though I'm also starting to think about the possibilities of running the prettier formatter separately for html/xhtml files.

Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
Depends on: 1809497

Once bug 1809497 this will be WFM, so I'm closing this early as that's the planned route.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.