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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zdr-tools/eslint-config-zdr

v1.0.0

Published

Shared ESLint configuration for consistent code style across ZDR projects.

Readme

@zdr-tools/eslint-config-zdr

Shared ESLint configuration for consistent code style across ZDR projects.

Overview

This package provides a comprehensive ESLint configuration tailored for ZDR projects, supporting TypeScript, React, and modern JavaScript development. It includes rules for code style, accessibility, React patterns, and testing with both Jest and Vitest. The configuration emphasizes consistent formatting, proper React usage, and accessibility best practices.

Installation

npm install @zdr-tools/eslint-config-zdr

Usage

Add to your ESLint configuration:

// eslint.config.js
import zdrConfig from '@zdr-tools/eslint-config-zdr';

export default zdrConfig;

Or extend in legacy format:

// .eslintrc.js
module.exports = {
  extends: ['@zdr-tools/eslint-config-zdr']
};

Configuration Features

File Support

  • TypeScript: .ts, .tsx files
  • JavaScript: .js files
  • React: JSX and TSX support
  • Ignores: dist/**/* build output

Language Options

  • ECMAScript: 2022 features
  • Modules: ES modules
  • Parser: TypeScript parser
  • Globals: Browser, Node.js, Vitest, and Jest

Plugin Integration

React

  • Component naming conventions
  • JSX formatting and structure
  • Props and state best practices
  • Self-closing component enforcement

Accessibility (jsx-a11y)

  • ARIA attributes validation
  • Semantic HTML enforcement
  • Keyboard navigation support
  • Screen reader compatibility

React Hooks

  • Rules of hooks enforcement
  • Dependency array validation (configured as warning)

TypeScript

  • Type annotation spacing
  • Unused variable detection
  • TypeScript-specific linting

Testing (Vitest/Jest)

  • Test file patterns
  • Testing best practices
  • Framework-specific globals

Code Style Rules

Formatting

  • 2-space indentation
  • Single quotes for strings
  • Semicolons required
  • Object curly spacing: { key: value }
  • Arrow function parentheses: as needed

Structural

  • Consistent object/array formatting
  • Proper spacing around operators
  • Block statement braces required
  • Consistent line breaks

Code Quality

  • No unused variables (with underscore prefix exception)
  • Prefer const over let
  • No console.log (warn/error allowed)
  • Equality operators: strict (===)

Example Configuration

// Your TypeScript/React component will be formatted like this:
import React, { useState, useCallback } from 'react';
import { User } from '../types';

interface UserCardProps {
  user: User;
  onEdit: (user: User) => void;
}

export function UserCard({ user, onEdit }: UserCardProps) {
  const [isExpanded, setIsExpanded] = useState(false);

  const handleEdit = useCallback(() => {
    onEdit(user);
  }, [user, onEdit]);

  return (
    <div className="user-card">
      <h3>{user.name}</h3>

      {isExpanded && (
        <div className="user-details">
          <p>Email: {user.email}</p>
          <button onClick={handleEdit}>
            Edit User
          </button>
        </div>
      )}

      <button
        onClick={() => setIsExpanded(!isExpanded)}
        aria-expanded={isExpanded}
      >
        {isExpanded ? 'Collapse' : 'Expand'}
      </button>
    </div>
  );
}

Supported File Patterns

This configuration automatically applies appropriate rules to:

  • Test files: **/*.test.{js,ts,tsx}, **/*.spec.{js,ts,tsx}
  • Test directories: **/test/**/*, **/__tests__/**/*, **/tests/**/*
  • Fake implementations: **/fakes/**/*
  • Config files: Various build and test configuration files

Accessibility Features

The configuration includes comprehensive accessibility rules:

  • ARIA attribute validation
  • Heading structure requirements
  • Image alt text guidelines (customizable)
  • Keyboard navigation support
  • Role and property validation

Integration with ZDR

This ESLint configuration is specifically tailored for ZDR projects:

  • Recognizes ZDR fake implementations pattern
  • Supports ZDR testing infrastructure
  • Enforces consistent code style across ZDR packages
  • Integrates with both Jest and Vitest testing frameworks

Customization

To customize rules for your project:

// eslint.config.js
import zdrConfig from '@zdr-tools/eslint-config-zdr';

export default [
  ...zdrConfig,
  {
    rules: {
      // Override specific rules
      'no-console': 'off',
      'react-hooks/exhaustive-deps': 'error'
    }
  }
];