@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.
21 lines (17 loc) • 468 B
JavaScript
import spawn from 'cross-spawn';
export const install = async (packageNames) => {
return await new Promise((resolve, reject) => {
const command = 'npm';
const args = ['i', '-D', ...packageNames];
const child = spawn(command, args, { stdio: 'inherit' });
child.on('close', (code) => {
if (code === 0) {
resolve();
} else {
reject({
command: `${command} ${args.join(' ')}`,
});
}
});
});
};