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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@effective/eslint-cfg

v0.8.3

Published

A library for generating ESLint Flat Configs with React and TypeScript support.

Readme

ESLint Config Builder

Sponsored by License Version Build Downloads

A TypeScript-based library for generating ESLint configurations in the Flat Config format, targeting TypeScript projects with optional NodeJS and React support.

Features

  • Generates ESLint Flat Configs for ESLint v9.
  • Requires TypeScript and optionally supports React and NodeJS
  • Automatically drops rules handled by Prettier.
  • Uses Biome data to optionally disable rules supported by Biome.

Config options

  • strict: Enables strict linting rules (TypeScript mostly)
  • style: Adds additional rules for style guidelines and import sorting/grouping.
  • fast: Drop rules which require typing information (much faster)
  • biome: Drop rules which are implemented identically in Biome (for performance reasons)
  • disabled: Only return disabled rules. Helpful to add to the end when using custom rules.
  • react: Add all recommended ReactJS/Hooks/Storybook checks
  • node: Add all recommended NodeJS checks

Installation

npm install @effective/eslint-cfg

Usage

// eslint.config.ts
import { getConfig } from "@effective/eslint-cfg"

const config = getConfig({
  react: true,
  strict: true,
  style: true
})

export default [
  {
    ignores: ["node_modules", "dist"]
  },
  {
    settings: {
      react: {
        version: "19.0"
      }
    }
  },
  {
    files: ["**/*.ts", "**/*.tsx"]
  },
  {
    rules: {
      // custom rules / overrides
    }
  }
]

Note: Using TS configuration files work perfectly fine since ESLint v9 but requires installing jiti.

API

The package exports the following functions:

getConfig(options)

Loads an ESLint configuration based on the provided options.

  • options - The configuration options
  • Returns: Promise resolving to the loaded ESLint configuration
import { getConfig } from "@effective/eslint-cfg"

const options = {
  react: true,
  strict: true,
  style: true
}

const config = await getConfig(options)
console.log(config.rules) // Access the ESLint rules

setRuleSeverity(config, ruleName, severity)

Changes the severity of a specific ESLint rule in the configuration.

  • config - The ESLint configuration
  • ruleName - The name of the rule to modify
  • severity - The new severity level ("error" | "warn" | "off")
  • Throws: When the config has no rules or the rule is not configured
import { getConfig, setRuleSeverity } from "@effective/eslint-cfg"

const config = await getConfig(options)
// Change 'no-console' rule to warning
setRuleSeverity(config, "no-console", "warn")

configureRule(config, ruleName, options)

Configures a specific ESLint rule in the configuration with its severity and optional parameters. Unlike setRuleSeverity, this method preserves the existing severity level while allowing to update the rule's options.

  • config - The ESLint configuration
  • ruleName - The name of the rule to configure
  • options - Optional array of configuration options for the rule
  • Throws: When the config has no rules or the rule is not configured
import { getConfig, configureRule } from "@effective/eslint-cfg"

const config = await getConfig(options)
// Configure 'max-len' rule with options while preserving severity
configureRule(config, "max-len", [{ code: 100, tabWidth: 2 }])

disableRule(config, ruleName)

Disables a specific ESLint rule in the configuration by removing it.

  • config - The ESLint configuration
  • ruleName - The name of the rule to disable
  • Throws: When the config has no rules or the rule is not configured
import { getConfig, disableRule } from "@effective/eslint-cfg"

const config = await getConfig(options)
// Completely remove the 'no-console' rule
disableRule(config, "no-console")

addRule(config, ruleName, severity, options)

Adds a new ESLint rule to the configuration with specified severity and options.

  • config - The ESLint configuration
  • ruleName - The name of the rule to add
  • severity - The severity level for the rule ("warn" | "error")
  • options - Additional options for the rule configuration
  • Throws: When the config has no rules or the rule is already configured
import { getConfig, addRule } from "@effective/eslint-cfg"

const config = await getConfig(options)
// Add new rule with options
addRule(config, "max-len", "error", [{ code: 100 }])

disableAllRulesBut(config, ruleName)

Disables all rules except the one specified. Useful for focusing on a single rule for debugging.

  • config - The ESLint configuration
  • ruleName - The name of the rule to add
  • Throws: When the config has no rules or the rule is already configured

Complete Example

import {
  getConfig,
  setRuleSeverity,
  disableRule,
  addRule
} from "@effective/eslint-cfg"

async function customizeEslintConfig() {
  // Load the base configuration
  const config = await getConfig({
    react: true,
    strict: true,
    style: true
  })

  // Customize rule severities
  setRuleSeverity(config, "no-console", "warn")
  setRuleSeverity(config, "no-unused-vars", "error")

  // Disable rules you don't want
  disableRule(config, "complexity")

  // Add new rule with options
  addRule(config, "max-len", "error", [{ code: 100 }])

  return config
}

Developer

Build

pnpm run build

License

Apache License; Version 2.0, January 2004

Copyright

Copyright 2024-2025Sebastian Software GmbH