2020-03-27 19:40:18 +00:00
|
|
|
# Contributing
|
2020-01-28 19:18:35 +00:00
|
|
|
|
2020-03-28 18:34:04 +00:00
|
|
|
If you want to dive into the details, please see the [contract](./contract.md)
|
2020-03-27 19:40:18 +00:00
|
|
|
that defines the contributor role in this project. If you're comfortable with
|
|
|
|
a top-level summary, you can start here first.
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
Our workflow is basically [GitHub Flow][github-flow] with specific roles:
|
2020-01-28 19:28:04 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
- **Contributor:** Write patches that reduce the number of problems.
|
|
|
|
- **Maintainers:** Merge patches that reduce the number of problems.
|
2020-01-28 19:28:04 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
If you have an issue, it's best to open an issue to describe the problem and
|
|
|
|
discuss solutions, but don't worry if you've already skipped that step.
|
2020-01-28 19:28:04 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
Assuming you already have a [developer install](./install.md) you should be
|
|
|
|
able to start editing source code. There are a few useful commands you should
|
|
|
|
know about:
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
- **`npm install`**: Ensure that software dependencies are installed.
|
|
|
|
- **`npm test`**: Ensure that all automated tests pass.
|
|
|
|
- **`npm run fix`**: If an automated test failed, this may fix it.
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
Please run `npm test` before writing a commit, because if there are errors then
|
|
|
|
maintainers won't be able to merge your patch. Please ask for help if `npm test`
|
|
|
|
is giving you any trouble.
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-11-22 18:16:56 +00:00
|
|
|
**Note:** `npm run fix` is run automatically as a pre-commit hook. You always
|
|
|
|
have the option to disable pre-commit hooks with `git commit --no-verify`.
|
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
## Frequently Failed Tests
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
### Unknown word
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 20:47:50 +00:00
|
|
|
<!-- spell-checker:disable -->
|
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
```
|
|
|
|
/src/index.js:10:42 - Unknown word (Scuttlebtut)
|
|
|
|
```
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 20:47:50 +00:00
|
|
|
<!-- spell-checker:enable -->
|
|
|
|
|
2020-04-13 16:03:37 +00:00
|
|
|
If this word is a typo, please fix the typo. If this error is a mistake, and
|
2020-03-27 19:40:18 +00:00
|
|
|
you're sure that this is a word, please add the word to `.cspell.json`.
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
### Code style issues found
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
```
|
|
|
|
Checking formatting...
|
|
|
|
src/index.js
|
|
|
|
README.md
|
|
|
|
Code style issues found in the above file(s). Forgot to run Prettier?
|
|
|
|
```
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
You can use `npm run fix` to resolve inconsistent code style. Please remember to
|
|
|
|
add those changes with `git add` or similar before you commit.
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
## Tips
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
### TypeScript opportunities
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
If you're looking for places where TypeScript would enjoy more detail, you can
|
|
|
|
run the TypeScript linter with `--noImplicitAny`:
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
```sh
|
|
|
|
npx tsc --allowJs --resolveJsonModule --lib es2018,dom --checkJs --noEmit --skipLibCheck --noImplicitAny src/index.js
|
|
|
|
```
|
2020-01-28 19:10:10 +00:00
|
|
|
|
2020-03-27 19:40:18 +00:00
|
|
|
[github-flow]: https://guides.github.com/introduction/flow/
|