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

@bonesofspring/eslint-react

v0.18.0

Published

Revy Ross ESLint flat config for React + TypeScript projects

Downloads

872

Readme

@bonesofspring/eslint-react

npm version license

ESLint flat config for React + TypeScript projects.

Note: This package is primarily intended for personal use by Revy Ross. It is published for convenience but may not suit all projects.

Table of Contents

Features

  • Import order — Sorted imports with import-x/order (fixable)
  • Unused imports — Auto-removal with unused-imports/no-unused-imports (fixable)
  • React & TypeScript — Airbnb-style rules, React Hooks, JSX a11y
  • Code quality — SonarJS, Unicorn, consistent type imports
  • Formatting — Prettier integration, @stylistic rules
  • Optional — Next.js, Jest, Testing Library, Markdown, Security, Promise, RegExp, JSDoc

Requirements

  • ESLint ^10.0.0
  • Prettier >= 3.0.0
  • TypeScript >= 5.0.0 (for type-aware rules and import resolver)
  • Node.js >= 22.12.0
  • Optional: eslint-import-resolver-typescript for TypeScript path aliases in import-x

Installation

yarn add -D @bonesofspring/eslint-react eslint prettier typescript eslint-import-resolver-typescript

Quick Start

// eslint.config.js
import config from '@bonesofspring/eslint-react'

export default config

Configuration

Full config (default)

Includes core React + TypeScript rules, scoped Jest/Testing Library rules for test files, and Markdown linting. Does not include Next.js or optional plugins (security, promise, regexp, jsdoc) — add them explicitly when needed.

// eslint.config.js
import config from '@bonesofspring/eslint-react'

export default config

Next.js project

// eslint.config.js
import config from '@bonesofspring/eslint-react'
import next from '@bonesofspring/eslint-react/next'

export default [...config, ...next]

Modular configs

Import only the configs you need:

// eslint.config.js
import core from '@bonesofspring/eslint-react/core'
import jest from '@bonesofspring/eslint-react/jest'
import markdown from '@bonesofspring/eslint-react/markdown'

export default [...core, ...jest, ...markdown]

Or compose from individual layers:

import base from '@bonesofspring/eslint-react/base'
import typescript from '@bonesofspring/eslint-react/typescript'
import react from '@bonesofspring/eslint-react/react'
import imports from '@bonesofspring/eslint-react/imports'
import stylistic from '@bonesofspring/eslint-react/stylistic'
import prettier from '@bonesofspring/eslint-react/prettier'

export default [
  ...base,
  ...typescript,
  ...react,
  ...imports,
  ...stylistic,
  ...prettier,
]

Optional plugins

import config from '@bonesofspring/eslint-react'
import security from '@bonesofspring/eslint-react/security'
import promise from '@bonesofspring/eslint-react/promise'

export default [...config, ...security, ...promise]

Editor Setup

Fix on save

VS Code / Cursor — add to settings.json:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit"
  }
}

WebStorm — Settings → Languages & Frameworks → JavaScript → Code Quality Tools → ESLint → enable Run eslint --fix on save.

TypeScript

  • Requires tsconfig.json (uses projectService: true).
  • For import-x resolver with TypeScript paths, install eslint-import-resolver-typescript (optional peer dependency).

Config Exports

| Export | Description | |--------|-------------| | . | Default preset (core + scoped jest/testing-library + markdown) | | ./core | Base React + TS preset without test/markdown scoping | | ./base | Base ESLint + Airbnb rules | | ./typescript | TypeScript ESLint (recommended + strict) | | ./react | React, React Hooks, JSX a11y, You Might Not Need an Effect | | ./imports | import-x (order, no-cycle, etc.) | | ./stylistic | @stylistic (semi, quotes, etc.) | | ./unicorn | Unicorn (rules disabled by default) | | ./sonarjs | SonarJS (recommended) | | ./jest | Jest (flat/recommended, scoped to *.{test,spec}.*) | | ./next | Next.js (opt-in, scoped to source files) | | ./prettier | Prettier + unused-imports | | ./markdown | Markdown (lint .md files) | | ./testing-library | Testing Library (flat/react, scoped to test files) | | ./security | Security (recommended, opt-in) | | ./promise | Promise (flat/recommended, opt-in) | | ./regexp | RegExp (flat/recommended, opt-in) | | ./jsdoc | JSDoc (flat/recommended-typescript, opt-in) |

Plugins and Rules

Core

@eslint/js (base)

  • Config: eslint.configs.recommended
  • Custom rules: Airbnb-style base (best practices, errors, ES6, style, variables), plus:
    • arrow-body-style, no-duplicate-imports, max-lines (300), no-param-reassign, no-console, no-debugger, no-unused-vars (off)

typescript-eslint

  • Config: recommended + strict
  • Custom rules: consistent-type-imports, naming-convention (I/T/E prefixes), no-require-imports, etc.

eslint-plugin-react

  • Rules: Airbnb-style React rules + overrides
  • Key: jsx-curly-brace-presence, jsx-filename-extension (.tsx), jsx-sort-props, function-component-definition (arrow-function)

eslint-plugin-react-hooks

  • Rules: rules-of-hooks (error), exhaustive-deps (warn)

eslint-plugin-react-you-might-not-need-an-effect

  • Config: recommended (detects unnecessary useEffect)

eslint-plugin-jsx-a11y

  • Rules: Airbnb-style accessibility rules

eslint-plugin-import-x

  • Rules: first, no-cycle, newline-after-import, order (groups, newlines-between), no-extraneous-dependencies

@stylistic/eslint-plugin

  • Rules: no-multiple-empty-lines, semi (never), padding-line-between-statements, quotes (single)

eslint-plugin-prettier

  • Rules: prettier/prettier (singleQuote, no semi, trailingComma: all, printWidth: 100)

eslint-plugin-unused-imports

  • Rules: no-unused-imports (error), no-unused-vars (warn, replaces @typescript-eslint/no-unused-vars)

Code quality

eslint-plugin-unicorn

  • Config: flat/recommended with project-specific overrides
  • Disabled: consistent-destructuring, filename-case, no-null, prevent-abbreviations, etc.
  • Custom: no-empty-file (warn)

eslint-plugin-sonarjs

  • Config: recommended
  • Override: no-duplicate-string (off)

Framework-specific

@next/eslint-plugin-next

  • Usage: opt-in via @bonesofspring/eslint-react/next
  • Rules: Next.js best practices (no-html-link-for-pages, no-head-element, no-document-import-in-page, etc.)

Optional (opt-in subpath exports)

Import these subpaths when needed — each enables the plugin's recommended rules:

  • eslint-plugin-jest — scoped to *.{test,spec}.* in default preset
  • eslint-plugin-testing-library — scoped to test files in default preset
  • eslint-plugin-security@bonesofspring/eslint-react/security
  • eslint-plugin-promise@bonesofspring/eslint-react/promise
  • eslint-plugin-regexp@bonesofspring/eslint-react/regexp
  • eslint-plugin-jsdoc@bonesofspring/eslint-react/jsdoc

@eslint/markdown

  • Files: **/*.md
  • Rules: All markdown rules (fenced-code-language, heading-increment, no-empty-links, etc.)

Maintenance

After bumping ESLint or plugin dependencies, verify that all rule IDs in the config still exist:

yarn validate:rules

Runs scripts/validate-rules.mjs against effective flat config for JS, TypeScript/TSX, test, and Markdown fixtures (scripts/fixtures/), plus opt-in subpaths (./next, ./security, etc.). Also run yarn smoke:lint for runtime ESLint 10 compatibility checks.

License

MIT