npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lint-init-framework

v1.3.0

Published

Framework to make your own lint-init CLI tool

Downloads

3

Readme

lint-init-framework

Framework to make your own lint-init CLI tool

Install

npm install --save lint-init-framework

Usage

Create lint-init.js (or whatever you name it)

#!/usr/bin/env node

import { makeCli } from 'lint-init-framework';

makeCli({
  packageName: '@myorg/lint-init',
  commandName: 'lint-init',
  version: '1.2.0',
  eslint: [{}],
  stylelint: [],
  markdownlint: {},
  prettier: {},
  editorconfig: '',
  vscode: {},
});

Modify your package.json:

{
  "bin": {
    "lint-init": "./lint-init.js"
  }
}

Options

packageName

name field in package.json

commandName

Name of the bin (see bin field in your package.json)

version

version field in package.json

eslint

Enalbe ESLint support

If you have multiple presets for different type of projects, pass an array of config with the following options:

eslint.deps

Entries of devDependencies.

makeCli({
  eslint: {
    deps: {
      'eslint-config-airbnb': '^8.0.0',
      'eslint-plugin-import': '^11.0.0',
    },
  },
});

eslint.config

Content of .eslintrc.json or eslintConfig field in package.json

eslint.configFile

File name of ESLint configuration

  • package.json (eslintConfig field)
  • .eslintrc
  • .eslintrc.json
  • .eslintrc.yaml
  • .eslintrc.js

eslint.ignore

Content of .eslintignore

makeCli({
  eslint: {
    ignore: `node_modules/
build/
coverage/
dist/
`,
  },
});

stylelint

Enalbe Stylelint support

If you have multiple presets for different type of projects, pass an array of config with the following options:

stylelint.deps

Entries of devDependencies.

makeCli({
  eslint: {
    deps: {
      'stylelint-config-standard': '^8.0.0',
      'stylelint-scss': '^5.0.0',
    },
  },
});

stylelint.config

Content of .stylelintrc.json or stylelint field in package.json

stylelint.configFile

File name of Stylelint configuration

  • package.json (stylelint field)
  • .stylelintrc
  • .stylelintrc.json
  • .stylelintrc.yaml
  • .stylelintrc.js

stylelint.ignore

Content of .eslintignore

makeCli({
  eslint: {
    ignore: `node_modules/
build/
coverage/
dist/
`,
  },
});

markdownlint

prettier

Enable Prettier support

prettier.deps

Entries of devDependencies.

makeCli({
  eslint: {
    deps: {
      prettier: '^3.0.0',
      'prettier-plugin-packagejson': '^2.0.0',
    },
  },
});

prettier.config

Content of .prettierrc.json or prettier field in package.json

prettier.configFile

File name of Stylelint configuration

  • package.json (prettier field)
  • .prettierrc
  • .prettierrc.json
  • .prettierrc.yaml
  • .prettierrc.js

prettier.ignore

Content of .prettierignore

makeCli({
  eslint: {
    ignore: `node_modules/
build/
coverage/
dist/
package-lock.json
pnpm-lock.yaml
yarn.lock
`,
  },
});

editorconfig

Content of .editorconfig:

makeCli({
  editorconfig: `# Generated by lint-init
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single
`,
});

vscode

VS Code configuration

vscode.settings

Content of .vscode/settings.json:

makeCli({
  vscode: {
    settings: {
      'eslint.validate': ['javascript', 'typescript'],
      'editor.codeActionsOnSave': {
        'source.fixAll.eslint': true,
        'source.organizeImports': true,
      },
      'editor.defaultFormatter': 'esbenp.prettier-vscode',
      'editor.formatOnSave': true,
      'editor.rulers': [100],
      '[javascript]': {
        'editor.defaultFormatter': 'esbenp.prettier-vscode',
      },
      '[typescript]': {
        'editor.defaultFormatter': 'esbenp.prettier-vscode',
      },
      '[json]': {
        'editor.defaultFormatter': 'esbenp.prettier-vscode',
      },
      '[jsonc]': {
        'editor.defaultFormatter': 'esbenp.prettier-vscode',
      },
    },
  },
});

vscode.extensions

Content of .vscode/extensions.json:

makeCli({
  vscode: {
    extensions: {
      recommendations: [
        'dbaeumer.vscode-eslint',
        'editorconfig.editorconfig',
        'esbenp.prettier-vscode',
      ],
    },
  },
});