decentralized-identity / decentralized-identity/web5-js

RFC: Adopt Prettier default config instead of eslint formatting rules

Open
#266 0 comments 0 reactions 1 assignee Claimed by @shamilovtim View on GitHub
Dominant language
TypeScript
Stars
142
Forks
56
PR merge metrics
No merged PRs in 30d

Description

- Start Date: 2023-11-07
- RFC PR:

# Summary

Encourage open source contributions and move toward community standard tooling by adopting Prettier as a formatter. Remove ad-hoc formatting rules from the eslint config.

# Motivation

Eslint says it will [no longer function as a formatter](https://eslint.org/blog/2023/10/deprecating-formatting-rules/#main). As a new contributor I forked web5-js and made some changes. I went to format but I noticed that no formatter was configured. This was surprising because as a regular OSS contributor I haven't encountered many recent JS projects that don't use Prettier.

# Drawbacks

- Adding prettier adds a CI step to format all PRs
- Contributors will need to be onboarded toward using Prettier and `formatOnSave`

# Alternatives

- There's [dprint](https://dprint.dev/) but for an open source project Prettier is standard

# Adoption strategy

- Add a .prettierrc to the project root. Use default prettier settings and [singlequote](singlequote) `{ singleQuote: true }`.
- Remove eslint formatter rules
- Bump eslint and plugins
- Add a vscode workspace setting to use `formatOnSave: true` and selected formatter `prettier`
- Add vscode recommended extension for Prettier
- Add a CI step to check prettier formatting
- Don't use eslint-prettier because it causes editor noise

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.