shareable ESLint config scaffolder for extending another config
$ npm install @form8ion/eslint-config-extender --save-prod
const {packageManagers} = await import('@form8ion/javascript-core');
const githubPlugin = await import('@form8ion/github');
const {questionNames: projectQuestionNames} = await import('@form8ion/project');
const javascriptPlugin = await import('@form8ion/javascript');
const {scaffold, extendEslintConfig} = await import('./lib/index.mjs');
(async () => {
await scaffold({
projectRoot: process.cwd(),
projectName: 'eslint-config-foo',
scope: 'bar'
});
})();
(async () => {
await extendEslintConfig(
{
decisions: {
[projectQuestionNames.PROJECT_NAME]: 'eslint-config-foo',
[projectQuestionNames.DESCRIPTION]: 'a description of the project',
[projectQuestionNames.VISIBILITY]: 'Public',
[projectQuestionNames.LICENSE]: 'MIT',
[projectQuestionNames.COPYRIGHT_HOLDER]: 'John Smith',
[projectQuestionNames.COPYRIGHT_YEAR]: '2022',
[projectQuestionNames.GIT_REPO]: true,
[projectQuestionNames.REPO_HOST]: 'GitHub',
[projectQuestionNames.REPO_OWNER]: 'org-name',
[javascriptPlugin.questionNames.AUTHOR_NAME]: 'John Smith',
[javascriptPlugin.questionNames.AUTHOR_EMAIL]: '[email protected]',
[javascriptPlugin.questionNames.AUTHOR_URL]: 'https://smith.org',
[javascriptPlugin.questionNames.SCOPE]: 'org-name',
[javascriptPlugin.questionNames.PACKAGE_MANAGER]: packageManagers.NPM,
[javascriptPlugin.questionNames.NODE_VERSION_CATEGORY]: 'LTS',
[javascriptPlugin.questionNames.CI_SERVICE]: 'Other',
[javascriptPlugin.questionNames.PROVIDE_EXAMPLE]: false
},
plugins: {vcsHosts: {GitHub: githubPlugin}}
},
decisions => ({
...javascriptPlugin,
scaffold: options => javascriptPlugin.scaffold({
...options,
decisions,
configs: {},
plugins: {unitTestFrameworks: {}}
})
})
);
})();
$ nvm install
$ npm install
$ npm test