Contributing
This repository uses npm workspaces to maintain a monorepo.
Directory Structure
All packages are located in the packages directory, and the documentation can be found in the website directory.
Installation
Fork it.
Clone it to your local directory. (Git is required.)
shgit clone https://github.com/lumirlumir/npm-clang-format-node.gitMove to the
npm-clang-format-nodedirectory.shcd npm-clang-format-nodeInstall npm packages. (Node.js is required.)
shnpm installEdit codes.
Create
my-branchbranch.shgit switch -c my-branchCommit your changes. (
huskyandlint-stagedwill lint your changed files!)shgit commit -am "<type>[optional scope]: <description>"Push them to your remote branch.
Submit a pull request.🙇♂️
Others
node: namespace
The node: namespace prefix for built-in modules was introduced in Node.js 14.18.0 and 16.0.0. While using it is recommended for new projects, we use different approaches in this project:
For regular application code, use standard imports without the
node:prefix for broader compatibility:js// Standard import (works in all Node.js versions) const fs = require('fs');For test files (
.test.js) that use thenode:testrunner, you may use thenode:prefix:js// node: prefix allowed in test files const fs = require('node:fs');
This approach helps maintain compatibility across Node.js versions while allowing modern syntax in test environments where version constraints are less critical.