hicommonwealth / commonwealth

A platform for decentralized communities
https://commonwealth.im
GNU General Public License v3.0
67 stars 41 forks source link

Keep imports sorted and remove unused imports #4884

Open kurtisassad opened 1 year ago

kurtisassad commented 1 year ago

Description

Title

Engineering Requirements

Acceptance Criteria

Additional context

gdjohnson commented 1 year ago

Based on the recent Slack discussion, it seems like there are some divergences between the linting system we're moving towards, and the linting system we have documented.

Here's what we have now in our "React Best Practices" file:

Pre-commit, we should run yarn format, which runs the prettier library to ensure our code is well-formatted. Down the line we may want to involve the Husky library in this process.

And in our "Code Requirements" file:

We use Prettier for formatting our codebase. There is only 1 prettier config and it is .prettierrc.json at the root of the repo. Formatting commands should always be executed from root. yarn format: execute prettier and format the entire repo yarn format-check: execute prettier in check mode which means it lists files that require formatting but doesn't actually format them

It sounds like we're moving towards a system where the engineer wouldn't need to run any scripts, because they'd be run automatically via the pre-commit hooks.

Anyway, nothing specifically actionable right now, but maybe when the PR is in, we can get the documentation updated.