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

@black-bytes/eslint-config

v0.2.0

Published

Black Bytes ESLint config - base and react

Downloads

361

Readme

@black-bytes/eslint-config

Reusable ESLint flat-config presets for Black Bytes projects.

Installation

Add the package alongside its peer dependencies in your project:

yarn add -D @black-bytes/eslint-config eslint typescript
# or
npm install -D @black-bytes/eslint-config eslint typescript

When consuming a local build, point to the workspace directory:

yarn add -D file:/path/to/eslint-config

Usage

Reference the presets from your eslint.config.js (or eslint.config.mjs) file together with your usual flat-config helpers.

For example:

import { defineConfig, globalIgnores } from 'eslint/config'
import globals from 'globals'
import blackBytesEslintConfig from '@black-bytes/eslint-config'

export default defineConfig([
  globalIgnores(['<ignored-directories-or-files>']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      blackBytesEslintConfig.base,
      blackBytesEslintConfig.react,
      blackBytesEslintConfig.next, // only for Next.js projects
      // additional presets or plugin configs
    ],
    // additional options
  },
])

Import a single preset when you only need one of them:

import { defineConfig } from 'eslint/config'
import { base as baseConfig } from '@black-bytes/eslint-config'

export default defineConfig([
  baseConfig,
  // project-specific overrides
])

All presets assume ESLint's Project Service is enabled, so TypeScript projects get typed linting out of the box.

Available presets

  • base: Core JavaScript/TypeScript rules, including stylistic and import guidelines.
  • react: React, React Hooks, and JSX accessibility rules layered on top of the base expectations.
  • next: Next.js-specific rules (core-web-vitals preset). Use only in Next.js projects, layered on top of base and react. Disables import/no-default-export because Next.js requires default exports for pages, layouts, and routes.

Mandatory best practices

General

  • Isolate type definitions: Declare shared types in dedicated *.types.ts files. This prevents circular fixes issues in the linter config and keeps domain models discoverable.

:warning: this is important to avoid linter conflicts

// ui.types.ts
export interface IButtonProps {
  label:   string
  onClick: () => void
}

export type TButtonVariant = 'primary' | 'ghost'
  • Apply consistent TS naming: Prefix interfaces with I and exported type aliases with T to distinguish structural contracts from concrete types at a glance. Example: IUser, IPermission, TRole, TButton.
export interface IUser {
  // ...
}

export type TRole = {
  // ...
}
  • Eliminate magic numbers: Lift numeric literals into constant maps, then export the derived union type via keyof typeof (in a separate file). This ensures consumers reuse the same source of truth.
// constants/metrics.ts
export const METRICS_THRESHOLDS = {
  warning:  50,
  critical: 75,
} as const

// types/metrics.types.ts
export type TMetricThreshold = keyof typeof METRICS_THRESHOLDS

React

  • Avoid inline handlers: Do not allocate arrow functions inside JSX props. Extract them into named callbacks so React can leverage referential equality and avoid redundant renders.
// discouraged
<Button onClick={() => doSomethingCool()} />

// required
const handleClick = () => doSomethingCool()
return <Button onClick={handleClick} />
  • Pre-compute derived props: Keep logical expressions and computed values out of JSX props. Materialize them in variables before rendering to improve readability and memoization.
// discouraged
<Card disabled={noData || isLoading} />
<Badge className={getClassName('badge', noData || isLoading)} />

// required
const isDisabled = noData || isLoading
const badgeClassName = getClassName('badge', isDisabled)

return (
  <>
    <Card disabled={isDisabled} />
    <Badge className={badgeClassName} />
  </>
)

Next.js

  • Default exports for app structure: The next preset disables import/no-default-export because Next.js requires default exports for pages, layouts, routes, and similar app structure files. Use the preset only in Next.js projects, layered on top of base and react.