title | description |
---|---|
Contributing |
Contributing to Mintlify |
Thank you for your interest in contributing to Mintlify! There are multiple ways to contribute, please feel free to ask for help on Discord or GitHub.
Everyone who contributes to Mintlify is expected to:
- Read and follow the Code of Conduct. We expect everyone in our community to be welcoming, helpful, and respectful.
We also encourage anyone interested in contributing to check out all the information here in our contributing guide, especially the contribution guidelines and standards.
We greatly appreciate your help! 💚
Make sure you have familiarized yourself with Development.
- Before opening a new issue, check if a similar issue or pull request already exists.
- Create a pull request with your changes and write a summary, as well as a test plan for the changes.
- When the PR is marked as ready for review, the engineering team will be notified and a contributor will handle it.
We are using contribution tools to simplify following our standards.
Staged files are linted and formatted automatically on `pre-commit`.- eslint - Analyzes code using multiple linting configurations/rules.
- prettier - Used to format text files.
- husky - Used to set up and manage git hooks.
- lint-staged - Runs eslint/prettier against staged files.
- pre-commit - Validates and cleans up git commits by running the above tools automatically, using a git hook.
It is possible and sometimes helpful to run the contribution tools manually.
- linting with
eslint
:yarn lint
- formatting with
prettier
:yarn format
- install git hooks (triggered automatically on
yarn install
):yarn prepare
- run
lint-staged
to check before committing and triggering thepre-commit
git hook:yarn lint-staged
To format the code as you make changes you can install the Prettier - Code formatter extension.
Add the following to your User Settings to run prettier on save.
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
If you encounter issues when trying to commit, it could be because one of the tools fails to conclude successfully.
`lint-staged` is using `--max-warnings 0`, which does not allow any warnings in staged files.If warnings and errors cannot be resolved in any way, or if refactoring old code, that includes warnings, one of the following workarounds can be used.
- Use
--no-verify
.
git commit --no-verify
- Disable
eslint
rule for line/file.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const x: any = {};
- Fix the warning with type assertions, utility types and generics.
- Discuss the issue or ask for help in an issue or PR.
Contributors of Mintlify are expected to:
- Read and follow the Code of Conduct.
- Read and follow the Mintlify code style.
- Code contribution guidelines are incomplete while Mintlify is still being developed and evolving, and may change later.
Projects should contain an eslint
and a prettier
config.
Please refer to these files for style rules.