Files
base-configs/packages/semantic-release-config/scripts/postinstall.cjs
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

27 lines
997 B
JavaScript

'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('release')
if (foundConfig.length > 0) {
console.log('semantic-release-config: Found existing semantic-release config file, skipping creation.')
console.log('semantic-release-config: If you want to create a new config file, please remove the existing one.')
console.log(`semantic-release-config: Found config files at: ${foundConfig.join(', ')}`)
process.exit(0)
}
const filePath = path.join(process.env.INIT_CWD, '.releaserc.json')
const fileConfigObject = {
extends: ['@ivuorinen/semantic-release-config']
}
if (!fs.existsSync(filePath)) {
fs.writeFileSync(filePath, JSON.stringify(fileConfigObject, undefined, 2))
}