Before diving in, file an issue before filing a PR whenever possible. This gives maintainers a chance to discuss design details with you upfront and avoids wasted effort.
Development prerequisites
Before you start, make sure you have the following installed:- bash and make
- Node.js v16.x or greater (with npm)
- Python v3.7 or greater (with pip)
How to contribute
Read CONTRIBUTING.md
Read the CONTRIBUTING.md in the repository for the full guidelines before making any changes.
Find or open an issue
Browse open issues on GitHub. Look for issues tagged “Good first issue” if you’re new to the project. If you’ve found a bug or want to propose a feature, open a new issue first.
Fork the repository
Fork beautifier/js-beautify on GitHub and clone your fork locally.
Make your change
js-beautify has two mostly identical implementations — JavaScript and Python. The HTML beautifier is JavaScript-only.Any change to one implementation must also be made to the other. This is a hard requirement. Familiarize yourself with the folder structure before you start:
Add tests for your change in
| Folder | Contents |
|---|---|
js/ | JavaScript implementation |
python/ | Python implementation |
web/ | beautifier.io website |
test/ | Shared test data and generators |
/test/data/*/test.js. Generated test files must be committed alongside your source changes.Run tests
Run the full test suite before committing. All generated test files must be checked in.JavaScript only:Python only:Both implementations (required before submitting a PR):Run the CI check locally after committing:You can also start a local dev server to manually test HTML/JS changes:
Submit a pull request
Push your branch and open a pull request against
main.- Run
make cilocally after your commit and before opening the PR. You can open the PR even if it reports errors, but the PR won’t be merged until all checks pass. - Include a description of your change. Add examples of input and expected output when relevant.
- Pull requests must pass CI checks on Linux and Windows across multiple versions of Node.js and Python before they are merged.
Reporting bugs
If you find a bug, open an issue and include:- Your environment (OS, Node.js version, Python version)
- A clear description of the current behavior
- What you believe the correct behavior should be
- A minimal example that reproduces the problem
Code of conduct
This project follows the standard open source code of conduct. Be respectful, constructive, and collaborative. See the repository’s code of conduct for details.Useful links
GitHub Issues
Browse open bugs and feature requests, or file a new issue.
Good First Issues
Find beginner-friendly issues to get started with.
Pull Requests
View open pull requests or submit your own.
CONTRIBUTING.md
Full contributing guidelines in the repository.