chore: tweaks and cleanup

This commit is contained in:
Ismo Vuorinen
2024-08-21 17:23:59 +03:00
parent cc63a2d1d7
commit ce9de621f6
14 changed files with 192 additions and 202 deletions

View File

@@ -24,7 +24,7 @@ Configuration packages located in this repository use this tool to check for exi
### Real world example
For commitlint-config you can find the usage in the [commitlint-config postinstall.js][commitlint-postinstall-link] file.
For commitlint-config you can find the usage in the [commitlint-config postinstall.cjs][commitlint-postinstall-link] file.
Here's a snippet from the file:
@@ -44,7 +44,7 @@ if (foundConfig.length > 0) {
### Locations scanned
| Searched configuration files |
| ----------------------------------- |
|-------------------------------------|
| `[module name]` |
| `[module name]`rc |
| `[module name]`rc.json |
@@ -122,13 +122,13 @@ See [CHANGELOG][changelog-link] for a human-readable history of changes.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
This project is licensed under the MIT License - see the [LICENSE.md][license-link] file for details.
[changelog-link]: ./CHANGELOG.md
[contributing-link]: https://github.com/ivuorinen/.github/blob/main/CONTRIBUTING.md
[issue-link]: https://github.com/ivuorinen/base-configs/issues
[license-badge]: https://img.shields.io/github/license/ivuorinen/base-configs?style=flat-square&labelColor=292a44&color=663399
[license-link]: ./LICENSE
[license-link]: ./LICENSE.md
[npm-badge]: https://img.shields.io/npm/v/@ivuorinen/config-checker?style=flat-square&labelColor=292a44&color=663399
[npm-link]: https://www.npmjs.com/package/@ivuorinen/config-checker
[pull-request-link]: https://github.com/ivuorinen/base-configs/pulls

View File

@@ -13,9 +13,7 @@ const configs = configChecker('test', path.join(__dirname, 'fixtures'))
* @param {string} file - The file to check for.
* @returns {boolean} - True if the array contains the file.
*/
function arrayContains(configs = [], file = '') {
return configs.some(config => config === file)
}
const arrayContains = (configs = [], file = '') => configs.some(config => config === file)
assert.ok(arrayContains(configs, '.testrc'))
assert.ok(arrayContains(configs, '.config/testrc.ts'))

View File

@@ -2,6 +2,7 @@
const fs = require('fs')
const path = require('path')
// noinspection NpmUsedModulesInstalled
const process = require('process')
const configurationPaths = require('./configuration-paths')

View File

@@ -7,7 +7,7 @@ const path = require('path')
* @param {string} moduleName - The name of the module to check for.
* @returns {string[]} - The paths to the configuration files.
*/
function configurationPaths(moduleName) {
const configurationPaths = moduleName => {
const filesPlain = [
moduleName,
`${moduleName}rc`,

View File

@@ -1,3 +1,3 @@
{
"extends": "@ivuorinen/markdownlint-config"
}
}

View File

@@ -1 +1 @@
"@ivuorinen/prettier-config"
"@ivuorinen/prettier-config"

View File

@@ -1,4 +1,3 @@
/* eslint-disable sonarjs/no-duplicate-string */
'use strict'
module.exports = {