@form8ion/eslint-config-extender
v10.0.2
Published
shareable ESLint config scaffolder for extending another config
Downloads
1,092
Readme
eslint-config-extender
shareable ESLint config scaffolder for extending another config
Table of Contents
Usage
Installation
$ npm install @form8ion/eslint-config-extender --save-prod
Example
Import
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');
Execute
Scaffolder Plugin
(async () => {
await scaffold({
projectRoot: process.cwd(),
projectName: 'eslint-config-foo',
scope: 'bar'
});
})();
High-Level Scaffolder
(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: {}}
})
})
);
})();
Contributing
Dependencies
$ nvm install
$ npm install
Verification
$ npm test