mirror of
https://github.com/ivuorinen/base-configs.git
synced 2026-02-26 20:52:37 +00:00
feat!: ESLint 9 Fixes (#307)
* chore: update postinstall scripts * chore(lint): eslint automated fixes * feat!: drop standard, sonarjs to work with eslint9 - This config allows arrow functions. BREAKING CHANGES: - Switches to eslint-config-eslint from eslint-config-standard. - Also drops eslint-plugins-sonarjs because it doesn't work well with eslint9, and wants eslint8 and related plugins. - Switches from eslint-plugin-prettier to eslint-config-prettier.
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
'use strict'
|
||||
/* eslint no-console: "off" -- CLI app that gives users feedback */
|
||||
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
const configChecker = require('..')
|
||||
const assert = require('assert').strict
|
||||
const assert = require('node:assert').strict
|
||||
|
||||
const configs = configChecker('test', path.join(__dirname, 'fixtures'))
|
||||
|
||||
/**
|
||||
* Checks if an array contains a file.
|
||||
*
|
||||
* @param {string[]} configs - The array of configs to check.
|
||||
* @param {string} file - The file to check for.
|
||||
* @param {string[]} c The array of configs to check.
|
||||
* @param {string} file The file to check for.
|
||||
* @returns {boolean} - True if the array contains the file.
|
||||
*/
|
||||
const arrayContains = (configs = [], file = '') => configs.some(config => config === file)
|
||||
const arrayContains = (c = [], file = '') => c.includes(file)
|
||||
|
||||
assert.ok(arrayContains(configs, '.testrc'))
|
||||
assert.ok(arrayContains(configs, '.config/testrc.ts'))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
'use strict'
|
||||
/* eslint no-console: "off" -- This is a cli app that generates cli output */
|
||||
|
||||
const configurationPaths = require('../lib/configuration-paths')
|
||||
|
||||
@@ -13,7 +13,7 @@ const mdTable = configItems.map(file => {
|
||||
console.log('# Configuration files\n')
|
||||
|
||||
const header = 'Searched configuration files'
|
||||
console.log('| ' + header + ' '.repeat(longestLine - header.length) + ' |')
|
||||
console.log('| ' + '-'.repeat(longestLine) + ' |')
|
||||
console.log(`| ${header}${' '.repeat(longestLine - header.length)} |`)
|
||||
console.log(`| ${'-'.repeat(longestLine)} |`)
|
||||
|
||||
mdTable.forEach(line => console.log(line))
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
'use strict'
|
||||
/* eslint no-console: "off", n/no-process-exit: "off" -- CLI app that gives users feedback */
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
// noinspection NpmUsedModulesInstalled
|
||||
const process = require('process')
|
||||
const process = require('node:process')
|
||||
const configurationPaths = require('./configuration-paths')
|
||||
|
||||
/**
|
||||
* Checks for the existence of a configuration file.
|
||||
* @param {string} moduleName - The name of the module to check for.
|
||||
* @param {string} pathPrefix - The prefix to add to the path.
|
||||
* @param {string} moduleName The name of the module to check for.
|
||||
* @param {string} pathPrefix The prefix to add to the path.
|
||||
* @returns {string[]} - The paths to the configuration files.
|
||||
*/
|
||||
const configChecker = (moduleName, pathPrefix = '') => {
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
'use strict'
|
||||
|
||||
const path = require('path')
|
||||
const path = require('node:path')
|
||||
|
||||
/**
|
||||
* Returns an array of configuration paths.
|
||||
* @param {string} moduleName - The name of the module to check for.
|
||||
* @param {string} moduleName The name of the module to check for.
|
||||
* @returns {string[]} - The paths to the configuration files.
|
||||
*/
|
||||
const configurationPaths = moduleName => {
|
||||
|
||||
Reference in New Issue
Block a user