@aak.lear/eslint-config
Version:
This package simplifies the initial setup of eslint and prettier. It installs and apply eslint-config-airbnb to your project, also resolves peerDependencies that are required for eslint-config-airbnb package.
17 lines (12 loc) • 442 B
JavaScript
import path from 'path';
import fs from 'fs-extra';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export const writeTemplate =
(root) =>
(name, targetName = name) => {
const filePath = path.resolve(root, targetName);
fs.copySync(path.resolve(__dirname, './templates', name), filePath);
console.log(`File created:\n${filePath}\n`);
};