feat: initial import from base-configs

This commit is contained in:
2025-06-23 02:24:27 +03:00
parent 8bbb574024
commit 3a9cef40bd
8 changed files with 1137 additions and 1 deletions

26
scripts/postinstall.cjs Normal file
View File

@@ -0,0 +1,26 @@
'use strict'
/* eslint no-console: "off", n/no-process-exit: "off", no-undefined: "off" -- CLI app that gives users feedback */
const fs = require('node:fs')
const path = require('node:path')
// noinspection NpmUsedModulesInstalled
const process = require('node:process')
const checkConfig = require('@ivuorinen/config-checker')
const foundConfig = checkConfig('markdownlint')
if (foundConfig.length > 0) {
console.log('markdownlint-config: Found existing markdownlint config file, skipping creation.')
console.log('markdownlint-config: If you want to create a new config file, please remove the existing one.')
console.log(`markdownlint-config: Found config files at: ${foundConfig.join(', ')}`)
process.exit(0)
}
const filePath = path.join(process.env.INIT_CWD, '.markdownlint.json')
const fileConfigObject = {
extends: '@ivuorinen/markdownlint-config'
}
if (!fs.existsSync(filePath)) {
fs.writeFileSync(filePath, JSON.stringify(fileConfigObject, undefined, 2))
}