web5-js
web5-js copied to clipboard
RFC: Adopt Prettier default config instead of eslint formatting rules
- 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. 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 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: true }
. - Remove eslint formatter rules
- Bump eslint and plugins
- Add a vscode workspace setting to use
formatOnSave: true
and selected formatterprettier
- Add vscode recommended extension for Prettier
- Add a CI step to check prettier formatting
- Don't use eslint-prettier because it causes editor noise