@form8ion/eslint-config-extender

8.1.2 • Public • Published

eslint-config-extender

shareable ESLint config scaffolder for extending another config

Codecov Node CI Workflow Status SLSA Level 2

Table of Contents

Usage

MIT license npm Try @form8ion/eslint-config-extender on RunKit node

Installation

$ npm install @form8ion/eslint-config-extender --save-prod

Example

Import

const {packageManagers} = await import('@form8ion/javascript-core');
const {questionNames: projectQuestionNames} = await import('@form8ion/project');
const {scaffold: javascriptScaffolder, questionNames: jsQuestionNames} = 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',
        [jsQuestionNames.AUTHOR_NAME]: 'John Smith',
        [jsQuestionNames.AUTHOR_EMAIL]: 'john@smith.org',
        [jsQuestionNames.AUTHOR_URL]: 'https://smith.org',
        [jsQuestionNames.SCOPE]: 'org-name',
        [jsQuestionNames.PACKAGE_MANAGER]: packageManagers.NPM,
        [jsQuestionNames.NODE_VERSION_CATEGORY]: 'LTS',
        [jsQuestionNames.CI_SERVICE]: 'Other',
        [jsQuestionNames.PROVIDE_EXAMPLE]: false
      },
      vcsHosts: {
        GitHub: {
          scaffolder: options => options,
          prompt: ({decisions}) => ({[projectQuestionNames.REPO_OWNER]: decisions[projectQuestionNames.REPO_OWNER]})
        }
      }
    },
    decisions => options => javascriptScaffolder({...options, decisions, unitTestFrameworks: {}})
  );
})();

Contributing

PRs Welcome Conventional Commits Commitizen friendly semantic-release Renovate

Dependencies

$ nvm install
$ npm install

Verification

$ npm test

Readme

Keywords

none

Package Sidebar

Install

npm i @form8ion/eslint-config-extender

Weekly Downloads

193

Version

8.1.2

License

MIT

Unpacked Size

19.5 kB

Total Files

6

Last publish

Collaborators

  • travi
  • form8ion-bot