包详细信息

@ivuorinen/config-checker

ivuorinen111MIT1.1.13

Checks the commonly used configuration locations for configuration files

check-config, config, ivuorinen, config-checker

自述文件

@ivuorinen/config-checker

npm package license MIT ivuorinen's Code Style

Check for existence of common configuration files in usually used locations.

Installation

Install this package as a dependency:

# npm
npm install @ivuorinen/config-checker --save

# Yarn
yarn add @ivuorinen/config-checker

Usage

This package is intended to be used in lifecycle events of other packages.

Configuration packages located in this repository use this tool to check for existence of configuration files, and if they exist, they will not create new ones.

Real world example

For commitlint-config you can find the usage in the commitlint-config postinstall.cjs file.

Here's a snippet from the file:

const process = require("process");
const checkConfig = require("@ivuorinen/config-checker");
const foundConfig = checkConfig("commitlint");

if (foundConfig.length > 0) {
  console.log("commitlint-config: Found existing commitlint config file, skipping creation.");
  console.log(
    "commitlint-config: If you want to create a new config file, please remove the existing one.",
  );
  console.log(`commitlint-config: Found config files at: ${foundConfig.join(", ")}`);
  process.exit(0);
}

Locations scanned

Searched configuration files
[module name]
[module name]rc
[module name]rc.json
[module name]rc.yaml
[module name]rc.yml
[module name]rc.js
[module name]rc.ts
[module name]rc.mjs
[module name]rc.cjs
[module name].jsonc
[module name].yaml
[module name].json
[module name].config.js
[module name].config.ts
[module name].config.mjs
[module name].config.cjs
.[module name]
.[module name]rc
.[module name]rc.json
.[module name]rc.yaml
.[module name]rc.yml
.[module name]rc.js
.[module name]rc.ts
.[module name]rc.mjs
.[module name]rc.cjs
.[module name].jsonc
.[module name].yaml
.[module name].json
.[module name].config.js
.[module name].config.ts
.[module name].config.mjs
.[module name].config.cjs
.config/[module name]
.config/[module name]rc
.config/[module name]rc.json
.config/[module name]rc.yaml
.config/[module name]rc.yml
.config/[module name]rc.js
.config/[module name]rc.ts
.config/[module name]rc.mjs
.config/[module name]rc.cjs
.config/[module name].jsonc
.config/[module name].yaml
.config/[module name].json
.config/[module name].config.js
.config/[module name].config.ts
.config/[module name].config.mjs
.config/[module name].config.cjs
.config/.[module name]
.config/.[module name]rc
.config/.[module name]rc.json
.config/.[module name]rc.yaml
.config/.[module name]rc.yml
.config/.[module name]rc.js
.config/.[module name]rc.ts
.config/.[module name]rc.mjs
.config/.[module name]rc.cjs
.config/.[module name].jsonc
.config/.[module name].yaml
.config/.[module name].json
.config/.[module name].config.js
.config/.[module name].config.ts
.config/.[module name].config.mjs
.config/.[module name].config.cjs

This list has been generated using npm run generate-table.

Contributing

If you are interested in helping contribute, please take a look at our contribution guidelines and open an issue or pull request.

Changelog

See CHANGELOG for a human-readable history of changes.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

更新日志

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

1.1.12 (2025-02-23)

Note: Version bump only for package @ivuorinen/config-checker

1.1.11 (2025-02-23)

Bug Fixes

1.1.10 (2025-01-17)

Bug Fixes

  • deps: update eslint-config-prettier to 10.0.1 (#324) (8a0d38e)

1.1.9 (2024-11-25)

Note: Version bump only for package @ivuorinen/config-checker

1.1.8 (2024-11-16)

Bug Fixes

  • upgrade browserslist from 4.24.0 to 4.24.2 (#302) (cbb1754)

1.1.7 (2024-10-20)

Bug Fixes

  • upgrade browserslist from 4.23.3 to 4.24.0 (#297) (a99c55a)

1.1.6 (2024-10-19)

Bug Fixes

  • upgrade markdownlint-cli from 0.41.0 to 0.42.0 (#298) (f57190d)

1.1.5 (2024-08-21)

Note: Version bump only for package @ivuorinen/config-checker

1.1.4 (2024-07-02)

Bug Fixes

  • workflows: commit lint fix (3cc07cf)

1.1.3 (2024-05-05)

Bug Fixes

  • add an initial value to "reduce()" call (#238) (52372db)

1.1.2 (2023-10-31)

Note: Version bump only for package @ivuorinen/config-checker

1.1.1 (2023-10-30)

Note: Version bump only for package @ivuorinen/config-checker

1.1.0 (2023-10-25)

Features

  • config-checker: new package: config-checker (9d37249)