Skip to content

[dev env] Define a standard formatting method for the codebase (mostly javascript). #1341

@XiaochenCui

Description

@XiaochenCui

puter currently has on format standard on js code, which causes some troubles for contributors:

  • when a contributor format a js file, it causes hundreds of diffs and make the pr hard to review
  • vscode "format modified lines" is a temporary workaround but only works for tiny commits. it failed when a commit involves changes to nest block (if/for/...)
  • different format tools yield different code, which makes a standard is desired

here I propose some solutions:

  • [short term] make a "format-only" commit when needed
  • [middle term] define a standard style for the code format, it should be integrated easily with popular editor (vim/vscode/...)
  • [long term] add lint to ci

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions