Skip to content

Add formatter for CSS and JS #123

@tim-schilling

Description

@tim-schilling

Code of Conduct

  • I agree to follow Django's Code of Conduct

Feature Description

The Django codebase should have a linter and code formatter for the CSS and JS.

There is more discussion on the forum.

Problem

From Tom:

For 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.

Request or proposal

request

Additional Details

I believe this should use Biome now that V2 has been released. However, I think that can be decided by the implementation team.

Implementation Suggestions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Contributing to DjangoDjango CoreThis idea is suitable for inclusion in Django itself.Frontend/JavaScriptNeeds teamThe feature needs a team to be formed to work on it. If you're interested, please comment.

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions