Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 1.79 KB

CONTRIBUTING.md

File metadata and controls

69 lines (43 loc) · 1.79 KB

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 docs directory.

Installation

  1. Fork it.

  2. Clone it to your local directory. (Git is required.)

    git clone https://github.com/lumirlumir/npm-clang-format-node.git
  3. Move to the npm-clang-format-node directory.

    cd npm-clang-format-node
  4. Install npm packages. (Node.js is required.)

    npm install
  5. Edit codes.

  6. Create my-branch branch.

    git switch -c my-branch
  7. Commit your changes. (husky and lint-staged will lint your changed files!)

    git commit -am "commit type: title"
  8. Push them to your remote branch.

  9. 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:

    // Standard import (works in all Node.js versions)
    const fs = require('fs');
  • For test files (.test.js) that use the node:test runner, you may use the node: prefix:

    // 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.