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

@gmjs/eslint-config

v0.0.41

Published

ESLint configuration.

Downloads

52

Readme

ESLint Config

This package contains a function used to create an ESLint config object.

Installation

npm install --save-dev @gmjs/eslint-config

Usage

Create an ESLint config file, one of:

  • eslint.config.js
  • eslint.config.cjs
  • eslint.config.mjs

Then use something like the following code (if using esm module syntax):

import { getEsLintConfigs } from '@gmjs/eslint-config';

export default [
  ...getEsLintConfigs({ projectType: 'node' })
];

Or equivalent commonjs syntax:

const { getEsLintConfigs } = require('@gmjs/eslint-config');

module.exports = [
  ...getEsLintConfigs({ projectType: 'node' })
];

API

getEsLintConfigs

Accepts a single parameter, options of type EslintConfigOptions.

Return a list of EsLint configurations, to be used in your project.

You can specify different project types:

  • 'shared' - For projects to be used from either Node or Browser.
  • 'node' - For Node.js projects.
  • 'browser' - For browser projects.
  • 'react' - For React projects.
import { getEsLintConfigs } from '@gmjs/eslint-config';

export default [...getEsLintConfigs({ projectType: 'node' })];

Types

EslintConfigOptions

type ProjectType = 'shared' | 'node' | 'browser' | 'react';

interface EslintConfigOptionsBase {
  readonly projectType: ProjectType;
}

interface EslintConfigOptionsReact extends EslintConfigOptionsBase {
  readonly projectType: 'react';
  readonly storybook: boolean;
}

interface EslintConfigOptionsBrowser extends EslintConfigOptionsBase {
  readonly projectType: 'browser';
}

interface EslintConfigOptionsNode extends EslintConfigOptionsBase {
  readonly projectType: 'node';
}

interface EslintConfigOptionsShared extends EslintConfigOptionsBase {
  readonly projectType: 'shared';
}

type EslintConfigOptions =
  | EslintConfigOptionsReact
  | EslintConfigOptionsBrowser
  | EslintConfigOptionsNode
  | EslintConfigOptionsShared;