Changes between Version 2 and Version 6 of Ticket #35007


Ignore:
Timestamp:
Feb 9, 2025, 3:44:20 AM (4 days ago)
Author:
Tom Carrick
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35007

    • Property Summary Add prettier to format CSS and JSAdd a formatter for CSS and JS
  • Ticket #35007 – Description

    v2 v6  
    55For motivation, I find myself fairly often in the admin CSS (especially lately) and it’s reasonably laid out for the most part, but there are things that are a little off. Sometimes the indentation is different from the rest of the file, for example. The JS is in a bit worse shape I think, some of the files have whitespace issues. These could be fixed but it would be better to enforce them in a way that’s easier to review, so I think a formatter makes sense here. What’s annoying (for me) is that when editing files, sometimes my editor “fixes” the issues for me, then I have to revert them and save without formatting. If I don’t spot my editor’s work, it’s more annoying to fix. Of course I could turn this stuff off somewhere, but if it’s annoying for me I’m sure it’ll be annoying for others as well.
    66
    7 I’m open to suggestions, but Thibaud suggested prettier, and I also use it myself. It doesn’t really require any configuration, though is configurable if people do have strong opinions.
    8 
    97But barring differing opinions there, the process would be something like:
    108
    11 Make a PR with three commits. The first sets up the machinery, installs prettier, adds to pre-commit, etc. The second does the work and the third adds the second commit to .git-blame-ignore-revs. As far as I know, the same as when black was set up.
     9Make a PR with three commits. The first sets up the machinery, installs the formatter, adds to pre-commit, etc. The second does the work and the third adds the second commit to .git-blame-ignore-revs. As far as I know, the same as when black was set up.
    1210
Back to Top