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.12.0

Published

Revy Ross ESLint flat config for React + TypeScript projects

Downloads

779

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
  • Node.js >= 20.0.0

Installation

# yarn
yarn add -D @bonesofspring/eslint-react eslint prettier

# npm
npm install -D @bonesofspring/eslint-react eslint prettier

# pnpm
pnpm add -D @bonesofspring/eslint-react eslint prettier

For TypeScript projects with import resolution:

yarn add -D eslint-import-resolver-typescript

Quick Start

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

export default config

Configuration

Full config (all plugins)

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

export default config

Modular configs

Import only the configs you need:

// eslint.config.js
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,
]

Next.js project

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

export default config

The full config already includes @next/eslint-plugin-next.

With Jest (test files only)

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

export default [
  ...config,
  {
    files: ['**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'],
    ...jestPlugin.configs['flat/recommended'],
    rules: {
      'jest/no-mocks-import': 'off',
    },
  },
]

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 | |--------|-------------| | . | Full config (all plugins) | | ./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 (plugin + globals) | | ./next | Next.js | | ./prettier | Prettier + unused-imports | | ./markdown | Markdown (lint .md files) | | ./testing-library | Testing Library | | ./security | Security | | ./promise | Promise | | ./regexp | RegExp | | ./jsdoc | JSDoc |

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: Plugin included; extend unicorn.configs.recommended for full ruleset
  • 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

  • Rules: Next.js best practices (no-html-link-for-pages, no-head-element, no-document-import-in-page, etc.)

Optional (plugins only)

These configs add the plugin but do not enable rules. Extend recommended in your config for test files or as needed:

  • eslint-plugin-jestjest.configs.flat.recommended for *.test.*, *.spec.*
  • eslint-plugin-testing-librarytestingLibrary.configs.recommended for test files
  • eslint-plugin-securitysecurity.configs.recommended
  • eslint-plugin-promisepromise.configs.recommended
  • eslint-plugin-regexpregexp.configs.recommended
  • eslint-plugin-jsdocjsdoc.configs.recommended

@eslint/markdown

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

License

MIT