mirror of
https://github.com/ivuorinen/base-configs-eslint.git
synced 2026-01-26 11:14:01 +00:00
chore: add publish workflow and developer tooling configurations (#73)
* feat(ci): new release flow, linting * chore: upgrade yarn, regenerate yarn.lock * feat: upgrade packages, publish workflow, lint * chore(lint): prettier default config * chore: remove gitHead from package.json * chore: upgrade workflows * chore: clean packages
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
'use strict'
|
||||
"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')
|
||||
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)
|
||||
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 filePath = path.join(process.env.INIT_CWD, "eslint.config.mjs");
|
||||
const fileConfig = `import ivuorinenConfig from '@ivuorinen/eslint-config';
|
||||
|
||||
export default [
|
||||
@@ -28,8 +28,8 @@ export default [
|
||||
}
|
||||
}
|
||||
];
|
||||
`
|
||||
`;
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
fs.writeFileSync(filePath, fileConfig)
|
||||
fs.writeFileSync(filePath, fileConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user