JSPM

@eslint-react/eslint-plugin

0.9.2-beta.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 256296
  • Score
    100M100P100Q172078F
  • License MIT

ESLint x React's main ESLint plugin. More than 50 ESLint rules to catch common mistakes and improve your React code. Built (mostly) from scratch.

Package Exports

  • @eslint-react/eslint-plugin
  • @eslint-react/eslint-plugin/package.json

Readme

logo

ESLint x React

More than 50 ESLint rules to catch common mistakes and improve your React code. Built (mostly) from scratch.

Supported engines

Node.js

  • 18.x LTS Hydrogen
  • 20.x Current

Bun

  • 1.0.15 or later

Installation

This plugin requires typescript and @typescript-eslint/parser as peer dependencies. Install them if you haven't already.

# npm
npm install --save-dev typescript @typescript-eslint/parser

# yarn
yarn add --dev typescript @typescript-eslint/parser

# pnpm
pnpm add --save-dev typescript @typescript-eslint/parser

# bun
bun add --dev typescript @typescript-eslint/parser

Then install the plugin.

# npm
npm install --save-dev @eslint-react/eslint-plugin

# yarn
yarn add --dev @eslint-react/eslint-plugin

# pnpm
pnpm add --save-dev @eslint-react/eslint-plugin

# bun
bun add --dev @eslint-react/eslint-plugin

Usage

Add @eslint-react to the plugins section of your .eslintrc.js configuration file.

module.exports = {
  // ...
  parser: "@typescript-eslint/parser",
  extends: ["plugin:@eslint-react/recommended"],
  plugins: ["@eslint-react"],
  // ...
};

Presets

Presets ↗

Rules

Rules ↗

Philosophy

  • Do what a linter should do
  • Focus on code rather than style
  • Rules are better than options

Rule introduction or modification principles

  1. No Auto-fix. Auto-fix is a great feature, but it's not always safe and reliable. We prefer to not to do auto-fix at all than to implement it in a way that can cause more problems than it solves.
  2. Formatting independent. Rules should check for correctness, not style. We recommend using style focused tools for formatting (e.g. dprint).
  3. Rules over options [1]. Each rule should have a single purpose. Make multiple rules work together to achieve more complex behaviors instead of adding options to a single rule.
  4. Sensible defaults. Rules should be easy to setup and use with minimal configuration and sensible defaults.

Contributing

Before you start working on something, it's best to check if there is an existing issue first. It's also a good idea to reach the maintainer and confirm if it makes sense or if someone else is already working on it.

Please make sure to read the Contributing Guide before making a pull request.

Pull requests submitted without prior discussion can also be rejected without prior discussion.

Thank you to everyone contributing to ESLint x React!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Inspiration

Prior art