in packages/f2elint/src/index.ts [18:46]
export default async function f2elint(project: string, options: F2elintOptions = {}) {
const projectFullPath = isAbsolute(project) ? project : join(process.cwd(), project);
const __dirname = dirname(fileURLToPath(import.meta.url));
const template = options?.template || 'base';
const initTemplate = (t: string) =>
init(join(__dirname, '..', 'templates', t), projectFullPath, options, {
disableLog: options.disableLog,
prettier,
bumpDependencies: true,
});
await initTemplate('base');
if (template !== 'base') {
await initTemplate(template);
}
if (options.stylelint) {
await initTemplate('stylelint');
}
if (options.prettier) {
await initTemplate('prettier');
}
if (options.lintStaged) {
await initTemplate('lint-staged');
}
if (options.commitlint) {
await initTemplate('commitlint');
}
}