Skip to content

Document or lint as much as possible of our code style #2604

Open
@IvanGoncharov

Description

@IvanGoncharov

We have a pretty uniform codebase which is very important for the reference implementation.
That said I the price that we pay for this it's extremely hard to start contributing since you get a huge amount of review comments in your first PR.
Also, it gave the wrong incentives to maintainers (including myself) to just rewriting PR from scratch since it was way easier than to explain what's wrong with the code.

Don't think that there is any silver bullet but we can do a couple of things:

  • Using existing linters and plugins for them (that said we don't want to be dependent on projects without big and active community).
  • Write custom ESLint rules for stuff that can be easily checked in JS AST
  • Expand our CONTRIBUTION.md
  • Investigate alternative tooling (e.g. Jest inline snapshots should solve issues with consistent formatting of JSON blobs in tests).

I think a good strategy would be to first work on common issues that most of the first-time contributors struggling with:

  • order of imports
  • keeping Flow and TS in sync (it would be an issue even after TS migration since we still need to keep Flow typing in sync).
  • properly export public APIs from main index.js and one of the top level folders
  • uniformity of JSON blobs in our tests
  • To be added

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions