Files
base-configs/packages/config-checker/helpers/generate-md-table.js
Ismo Vuorinen 6d6f4582dd 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.
2024-11-25 03:35:13 +02:00

20 lines
670 B
JavaScript

/* eslint no-console: "off" -- This is a cli app that generates cli output */
const configurationPaths = require('../lib/configuration-paths')
const configItems = configurationPaths('`[module name]`')
const longestLine = configItems.reduce((a, b) => (a.length > b.length ? a : b), 0).length
const mdTable = configItems.map(file => {
const diff = longestLine - file.length
return `| ${file}${' '.repeat(diff)} |`
})
console.log('# Configuration files\n')
const header = 'Searched configuration files'
console.log(`| ${header}${' '.repeat(longestLine - header.length)} |`)
console.log(`| ${'-'.repeat(longestLine)} |`)
mdTable.forEach(line => console.log(line))