# 1.0.0 (2025-10-10) ### Bug Fixes * **ci:** .npmrc with token as an env ([316f897](316f897610)) * **ci:** add NPM_TOKEN to publish ([f144f27](f144f2771f)) * **ci:** publish.yml tweaks ([cebafd2](cebafd26a9)) * **ci:** release pat ([e78ab2a](e78ab2ac48)) * **ci:** switch to cycjimmy/semantic-release-action ([6ce643c](6ce643cdcb)) * **ci:** update publish pipeline permissions ([#6](https://github.com/ivuorinen/config-checker/issues/6)) ([1947d77](1947d77854)) * **github-action:** update actions/cache (v4.2.3 → v4.2.4) ([#15](https://github.com/ivuorinen/config-checker/issues/15)) ([738b712](738b7129d9)) * **github-action:** update ivuorinen/actions (25.6.23 → 25.6.25) ([#5](https://github.com/ivuorinen/config-checker/issues/5)) ([08563a1](08563a10d1)) * **github-action:** update ivuorinen/actions (25.6.25 → 25.6.30) ([#7](https://github.com/ivuorinen/config-checker/issues/7)) ([7e367c7](7e367c7a3d)) * **github-action:** update ivuorinen/actions (25.7.14 → 25.7.21) ([#11](https://github.com/ivuorinen/config-checker/issues/11)) ([dc1599d](dc1599db1f)) * **github-action:** update ivuorinen/actions (25.7.21 → 25.7.28) ([#12](https://github.com/ivuorinen/config-checker/issues/12)) ([3fb1101](3fb1101858)) * **github-action:** update ivuorinen/actions (25.7.7 → 25.7.14) ([#10](https://github.com/ivuorinen/config-checker/issues/10)) ([885a9fd](885a9fd180)) * **github-action:** update ivuorinen/actions (25.8.18 → 25.8.21) ([#21](https://github.com/ivuorinen/config-checker/issues/21)) ([7348f3a](7348f3a4d2)) * **github-action:** update ivuorinen/actions (25.8.4 → 25.8.18) ([#17](https://github.com/ivuorinen/config-checker/issues/17)) ([391c1f5](391c1f5443)) * **github-release:** update adrienverge/yamllint (v1.37.0 → v1.37.1) ([#19](https://github.com/ivuorinen/config-checker/issues/19)) ([89ae36c](89ae36c0ff)) * **github-release:** update bridgecrewio/checkov (3.2.400 → 3.2.464) ([#20](https://github.com/ivuorinen/config-checker/issues/20)) ([8ea111d](8ea111de5f)) * **github-release:** update renovatebot/pre-commit-hooks (41.82.6 → 41.82.9) ([#28](https://github.com/ivuorinen/config-checker/issues/28)) ([92e53c4](92e53c49cd)) * **lint:** .mega-linter.yml too many empty lines ([52cbe31](52cbe31c40)) ### Features * **ci:** update codeql ([#3](https://github.com/ivuorinen/config-checker/issues/3)) ([18f0015](18f0015ccf)) * **github-action:** update actions/checkout (v4.2.2 → v4.3.0) ([#18](https://github.com/ivuorinen/config-checker/issues/18)) ([0f7f989](0f7f989c5d)) * **github-action:** update ivuorinen/actions (25.6.30 → 25.7.7) ([#8](https://github.com/ivuorinen/config-checker/issues/8)) ([cb09795](cb09795ba4)) * **github-action:** update ivuorinen/actions (25.7.28 → 25.8.4) ([#14](https://github.com/ivuorinen/config-checker/issues/14)) ([7783dc8](7783dc8c36)) * **github-release:** update igorshubovych/markdownlint-cli (v0.44.0 → v0.45.0) ([#22](https://github.com/ivuorinen/config-checker/issues/22)) ([20be1f2](20be1f2ea7)) * **github-release:** update koalaman/shellcheck-precommit (v0.10.0 → v0.11.0) ([#23](https://github.com/ivuorinen/config-checker/issues/23)) ([a95abdb](a95abdb1c2)) * initial import from base-configs ([2c000e8](2c000e8e7e))
@ivuorinen/config-checker
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.