feat: initial import from base-configs

This commit is contained in:
2025-06-23 02:22:14 +03:00
parent 477603a641
commit 674071ec7d
11 changed files with 3178 additions and 1 deletions

35
scripts/postinstall.cjs Normal file
View File

@@ -0,0 +1,35 @@
'use strict'
/* eslint no-console: "off", n/no-process-exit: "off" -- CLI app that gives users feedback */
const fs = require('node:fs')
const path = require('node:path')
const process = require('node:process')
const checkConfig = require('@ivuorinen/config-checker')
const foundConfig = checkConfig('eslint')
if (foundConfig.length > 0) {
console.log('eslint-config: Found existing eslint config file, skipping creation.')
console.log('eslint-config: If you want to create a new config file, please remove the existing one.')
console.log(`eslint-config: Found config files at: ${foundConfig.join(', ')}`)
process.exit(0)
}
const filePath = path.join(process.env.INIT_CWD, 'eslint.config.mjs')
const fileConfig = `import ivuorinenConfig from '@ivuorinen/eslint-config';
export default [
...ivuorinenConfig,
// your modifications
{
rules: {
// "no-unused-vars": "warn"
}
}
];
`
if (!fs.existsSync(filePath)) {
fs.writeFileSync(filePath, fileConfig)
}