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

@dmitryrechkin/eslint-standard

v1.5.4

Published

This package provides a shared ESLint configuration which includes TypeScript support and a set of specific linting rules designed to ensure high-quality and consistent code style across projects.

Downloads

328

Readme

@dmitryrechkin/eslint-standard

A comprehensive ESLint configuration package with TypeScript support, featuring Prettier integration with Allman brace style and industry-standard rules for maximum code quality.

🚀 Quick Start

Installation

npm install -D @dmitryrechkin/eslint-standard
npx @dmitryrechkin/eslint-standard install-deps

Basic Usage

// eslint.config.mjs
import config from '@dmitryrechkin/eslint-standard';

export default config({
	tsconfigPath: './tsconfig.json'
});

📋 Available Presets

Standard (Default)

Balanced configuration suitable for most projects.

import config from '@dmitryrechkin/eslint-standard';
export default config();

Aggressive

Enhanced unused code detection for maximum code quality.

import config from '@dmitryrechkin/eslint-standard/aggressive';
export default config();

Features:

  • ✅ Enhanced unused variable detection
  • ✅ Import/export cleanup
  • ✅ Dead code detection (unreachable code)
  • ✅ Strict unused expressions rules
  • ✅ TypeScript-specific cleanup

Library

Optimized for TypeScript libraries with strict API requirements.

import config from '@dmitryrechkin/eslint-standard/library';
export default config();

Features:

  • ✅ Very strict unused exports detection
  • ✅ API documentation requirements (JSDoc)
  • ✅ Explicit return types
  • ✅ No console/debugging code
  • ✅ Enhanced type safety rules

⚙️ Configuration Options

All configurations accept the same configuration options:

export default config({
	tsconfigPath: './tsconfig.json',    // Path to TypeScript config
	ignores: ['build/**', 'dist/**'],   // Additional ignore patterns
	files: ['src/**/*'],                // File patterns to lint
	rules: {                           // Rule overrides
		'no-console': 'warn'
	}
});

🛠️ CLI Commands

The package includes a CLI for dependency management:

# Install all peer dependencies
npx @dmitryrechkin/eslint-standard install-deps

# Check if dependencies are installed
npx @dmitryrechkin/eslint-standard check-deps

# Auto-install missing dependencies
npx @dmitryrechkin/eslint-standard check-deps --install

🎯 Rule Categories

Code Quality & Safety

  • Type Safety: Strict TypeScript rules, ban any type
  • Error Prevention: Catch common bugs and unsafe patterns
  • Security: Prevent common security vulnerabilities
  • Performance: Avoid performance anti-patterns

Code Style & Formatting

  • Prettier Integration: Automatic code formatting with industry-standard plugins
  • Brace Style: Allman style (braces on new lines) via prettier-plugin-brace-style
  • Indentation: Tabs (4-space width) for accessibility and user preference
  • Quotes: Single quotes for consistency
  • Import Organization: Automatic import sorting and grouping
  • JSDoc: Required documentation with proper alignment and formatting

Code Complexity & Architecture

  • Function Complexity: Max 10 cyclomatic complexity (industry standard)
  • Cognitive Complexity: Max 15 (SonarJS) for maintainable code
  • Function Length: Max 100 lines (300 for tests) following clean code principles
  • File Length: Max 300 lines (500 for tests) for focused modules
  • Function Parameters: Max 7 parameters (allows dependency injection patterns)
  • Nesting Depth: Max 3 levels to prevent callback hell

Modern JavaScript/TypeScript

  • ES2020+ Features: Prefer modern syntax and APIs
  • Functional Programming: Pragmatic immutability patterns
  • Promise Handling: Proper async/await usage
  • Import/Export: Clean module system usage

📊 Preset Comparison

| Feature | Standard | Aggressive | Library | |---------|----------|------------|---------| | Unused imports cleanup | ✅ | ✅ | ✅ | | Unused variables detection | Basic | Enhanced | Enhanced | | Dead code detection | Basic | ✅ | ✅ | | Unused exports check | ❌ | ✅ | Very Strict | | JSDoc requirements | Basic | Basic | Strict | | Console statements | Warning | Warning | Error | | Return type hints | Error | Error | Explicit | | Type safety | High | High | Very High |

📈 Industry Standards Comparison

| Metric | This Package | Google | Airbnb | SonarQube | Clean Code | |--------|--------------|--------|---------|-----------|------------| | Max Parameters | 7 | 4 | No limit* | 7 | 3-4 | | Max Function Lines | 100 | 50 | No limit | 200 | 20 | | Max File Lines | 300 | 2000 | 2500 | 1000 | 300 | | Cyclomatic Complexity | 10 | 10 | No limit | 10 | 5-10 | | Max Nesting | 3 levels | 3 levels | No limit | 3 levels | 2-3 levels | | Brace Style | Allman | 1TBS | 1TBS | Configurable | Any | | Indentation | Tabs (4) | Spaces (2) | Spaces (2) | Configurable | Spaces (4) |

*Airbnb recommends objects for >3 parameters

🎨 Prettier Integration Features

This package includes seamless Prettier integration that handles all formatting automatically:

Supported File Types

  • TypeScript/JavaScript: .ts, .js, .tsx, .jsx with Allman brace style
  • Astro: .astro files with optimized formatting via prettier-plugin-astro

Automatic Formatting

  • Allman Brace Style: All braces on new lines for maximum readability
  • Single Quotes: Consistent string quoting throughout codebase
  • Tab Indentation: Accessible indentation with 4-space tab width
  • Semicolons: Always required for statement clarity
  • No Trailing Commas: Clean object/array formatting

ESLint-Prettier Harmony

  • All conflicting ESLint formatting rules are automatically disabled
  • Prettier handles formatting, ESLint handles code quality
  • No configuration conflicts - works out of the box

🔧 External Tools Integration

For comprehensive unused code detection, consider these additional tools:

# Find unused exports
npx ts-prune

# Find unused files  
npx unimported

# Advanced dead code analysis
npx knip

# Find unused dependencies
npx depcheck

🚦 Usage Recommendations

For Applications

Use Standard preset - provides good balance of strictness and practicality.

For Libraries

Use Library preset - ensures clean public APIs and comprehensive documentation.

For Maximum Code Quality

Use Aggressive preset - comprehensive unused code detection.

🔍 Example Projects

React Application

// eslint.config.mjs
import config from '@dmitryrechkin/eslint-standard';

export default config({
	tsconfigPath: './tsconfig.json',
	ignores: ['dist/**', 'build/**', 'public/**']
});

TypeScript Library

// eslint.config.mjs
import config from '@dmitryrechkin/eslint-standard/library';

export default config({
	tsconfigPath: './tsconfig.json',
	ignores: ['dist/**', 'examples/**']
});

Node.js API

// eslint.config.mjs
import config from '@dmitryrechkin/eslint-standard/aggressive';

export default config({
	tsconfigPath: './tsconfig.json',
	rules: {
		'no-console': 'off', // Allow console in Node.js
	}
});

🤝 Contributing

Issues and pull requests are welcome on GitHub.

📄 License

MIT License - see LICENSE file for details.