mirror of
https://github.com/ivuorinen/config-checker.git
synced 2026-02-13 02:48:08 +00:00
feat: modernize workflows and standardize configuration files (#85)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const path = require('node:path')
|
||||
const path = require("node:path");
|
||||
|
||||
/**
|
||||
* Returns an array of configuration paths.
|
||||
* @param {string} moduleName The name of the module to check for.
|
||||
* @returns {string[]} - The paths to the configuration files.
|
||||
*/
|
||||
const configurationPaths = moduleName => {
|
||||
const configurationPaths = (moduleName) => {
|
||||
const filesPlain = [
|
||||
moduleName,
|
||||
`${moduleName}rc`,
|
||||
@@ -22,14 +22,14 @@ const configurationPaths = moduleName => {
|
||||
`${moduleName}.config.js`,
|
||||
`${moduleName}.config.ts`,
|
||||
`${moduleName}.config.mjs`,
|
||||
`${moduleName}.config.cjs`
|
||||
]
|
||||
`${moduleName}.config.cjs`,
|
||||
];
|
||||
|
||||
const filesDot = filesPlain.map(file => `.${file}`)
|
||||
const bothFiles = filesPlain.concat(filesDot)
|
||||
const filesInConfig = bothFiles.map(file => path.join('.config', file))
|
||||
const filesDot = filesPlain.map((file) => `.${file}`);
|
||||
const bothFiles = filesPlain.concat(filesDot);
|
||||
const filesInConfig = bothFiles.map((file) => path.join(".config", file));
|
||||
|
||||
return bothFiles.concat(filesInConfig)
|
||||
}
|
||||
return bothFiles.concat(filesInConfig);
|
||||
};
|
||||
|
||||
module.exports = configurationPaths
|
||||
module.exports = configurationPaths;
|
||||
|
||||
Reference in New Issue
Block a user