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

eslint-performance

v0.1.9

Published

Standalone runner for ESLint performance analysis - detects runtime complexity issues

Readme

eslint-performance

Standalone runner for detecting runtime complexity issues in JavaScript and TypeScript code. No configuration required - just run and get instant performance insights.

Features

  • Zero Configuration: Works out of the box without any setup
  • TypeScript & JavaScript: Analyzes both .js/.jsx and .ts/.tsx files
  • Performance-Focused Rules: Detects quadratic loops, immutable reduce patterns, and unnecessary array operations
  • CI/CD Ready: Exit codes and JSON output for automation

Usage

Quick Start

Run analysis on current directory:

npx eslint-performance

Analyze Specific Paths

# Analyze a specific directory
npx eslint-performance src/

# Analyze specific files
npx eslint-performance src/utils.ts src/helpers.js

# Use glob patterns
npx eslint-performance "src/**/*.ts"

Options

# JSON output (useful for tooling/CI)
npx eslint-performance --json

# Quiet mode (only show files with issues)
npx eslint-performance --quiet

# Combine options
npx eslint-performance src/ --quiet --json

Rules

This runner automatically enables these performance-focused rules:

no-quadratic-loop-operations

Detects operations inside loops that scale quadratically with input size.

Example Issue:

for (const item of items) {
  filtered = filtered.filter(x => x !== item);  // O(n²)
}

no-immutable-reduce

Detects spreading accumulator in reduce, causing O(n²) complexity.

Example Issue:

arr.reduce((acc, item) => [...acc, item], []);  // O(n²)

no-unnecessary-array-spread

Detects unnecessary array spread operations that create redundant copies.

Example Issue:

[...arr].map(x => x * 2);  // Unnecessary copy

CI/CD Integration

The runner exits with code 1 if any issues are found, making it perfect for CI pipelines:

# GitHub Actions example
- name: Check performance issues
  run: npx eslint-performance
# Local pre-commit hook
npx eslint-performance src/ || exit 1

Output Example

/path/to/file.ts
  15:3  warning  Spreading accumulator in reduce creates O(n²) complexity  runtime-complexity/no-immutable-reduce
  23:5  warning  Quadratic loop operation detected  runtime-complexity/no-quadratic-loop-operations

2 problems found in 1 file

Relationship with the Plugin Package

This runner is a standalone CLI tool that provides a zero-configuration way to check your code for performance issues. It uses the @eslint-performance/plugin-runtime-complexity ESLint plugin under the hood, with all rules pre-configured.

Runner vs Plugin: Which to Use?

Use this runner (eslint-performance) when:

  • You want quick, one-off performance checks without configuration
  • You don't have ESLint set up or want separate performance checks
  • You're running checks in CI/CD without modifying your ESLint config
  • You prefer the convenience of npx for ad-hoc analysis

Use the plugin (@eslint-performance/plugin-runtime-complexity) when:

  • You have an existing ESLint setup and want to integrate performance checks
  • You need to customize rule configurations or severity levels
  • You want to disable specific rules while keeping others
  • You want performance checks to run automatically with your regular linting

Installation (Optional)

We recommend using npx instead of installing - it's simpler, always gives you the latest version, and doesn't clutter your dependencies:

# Recommended: Use npx (no installation needed)
npx eslint-performance

# Only install if you really need it globally
npm install -g eslint-performance

If you must add it as a dev dependency:

npm install --save-dev eslint-performance

Then add to your package.json scripts:

{
  "scripts": {
    "check:perf": "eslint-performance src/"
  }
}

When to Use

Use this tool when you want:

  • Quick performance audits without ESLint configuration
  • One-off analysis of codebases
  • CI/CD performance checks
  • Pre-commit performance validation

For ongoing development with custom ESLint configs, use the plugin directly.

License

MIT

Author

JonasBa [email protected]