Contributing
This repository uses npm workspaces
and lerna
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.)
bashgit clone https://github.com/lumirlumir/npm-clang-format-node.git
Move to the
npm-clang-format-node
directory.bashcd npm-clang-format-node
Install npm packages. (Node.js is required.)
bashnpm install
Edit codes.
Create
my-branch
branch.bashgit switch -c my-branch
Commit your changes. (
husky
andlint-staged
will lint your changed files!)bashgit 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:test
runner, 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.