# @inrupt/eslint-config-react

> Shared eslint config for React projects at @inrupt

Latest version **3.2.7** (published 2025-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @inrupt/eslint-config-react
pnpm add @inrupt/eslint-config-react
yarn add @inrupt/eslint-config-react
bun add @inrupt/eslint-config-react
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.2.7 |
| Published | 2025-04-29 |
| First published | 2020-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Inrupt <engineering@inrupt.com> |
| Maintainers | timbl, rubenverborgh, nseydoux, inrupt_ci, astrid.vazquez |
| Keywords | eslint, react, inrupt |

## Links

- npm: https://www.npmjs.com/package/@inrupt/eslint-config-react
- Repository: https://github.com/inrupt/typescript-sdk-tools
- Homepage: https://github.com/inrupt/typescript-sdk-tools/tree/main/eslint-configs/eslint-config-react#readme
- Issues: https://github.com/inrupt/typescript-sdk-tools/issues
- npm.io page: https://npm.io/package/@inrupt/eslint-config-react

## Dependencies (6)

- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.37.5
- [@babel/eslint-parser](https://npm.io/package/@babel/eslint-parser.md) ^7.27.0
- [eslint-config-airbnb](https://npm.io/package/eslint-config-airbnb.md) ^19.0.4
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.10.2
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^5.2.0
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) 3.2.7

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.2.7 (latest) — 2025-04-29
- 1.0.1-alpha.0 (next) — 2022-07-06
- 3.2.6 — 2025-03-20
- 3.2.5 — 2025-03-10
- 3.2.4 — 2024-09-19
- 3.2.3 — 2024-08-23
- 3.2.2 — 2024-08-20
- 3.2.1 — 2024-02-23
- 3.2.0 — 2024-02-12
- 3.1.0 — 2024-02-02
- 3.0.2 — 2023-12-20
- 3.0.1 — 2023-12-18
- 3.0.0 — 2023-12-18
- 2.6.0 — 2023-12-08
- 2.5.0 — 2023-10-18
- … 44 more at https://npm.io/package/@inrupt/eslint-config-react/versions

## README

# eslint-config-inrupt-react

Eslint and prettier configs

## Installation

1. `npm install --save-dev @inrupt/eslint-config-react @rushstack/eslint-patch`

## Setup (Quick start)

Create a `.eslintrc.js` in the the root of your project with the following contents:

```js
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
  extends: ["@inrupt/eslint-config-react"],
  parserOptions: {
    project: "./tsconfig.eslint.json",
  },
  rules: {},
};
```

The file `tsconfig.eslint.json` is your typescript configuration with the e2e tests, unit tests and examples included, e.g.,

```json
{
  "extends": "./tsconfig.json",
  "include": ["src/**/*.ts", "e2e/**/*.ts", "*.md"],
  "exclude": ["**/node_modules", "**/dist/**"]
}
```

### For typescript projects:

```js
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
  root: true,

  extends: [
    "@inrupt/eslint-config-react",
    "@inrupt/eslint-config-lib",
    "plugin:import/typescript",
  ],

  parserOptions: {
    project: "./tsconfig.eslint.json",
  },

  // These settings and the `plugin:import/typescript` are required until we add
  // this configuration to our @inrupt/eslint-config-lib base
  settings: {
    "import/parsers": {
      "@typescript-eslint/parser": [".ts", ".tsx"],
    },
    "import/resolver": {
      typescript: {
        alwaysTryTypes: true,
        project: "./tsconfig.eslint.json",
      },
    },
  },

  rules: {
    "react/jsx-filename-extension": [
      "error",
      {
        extensions: [".tsx"],
      },
    ],
  },
};
```

## Migrating to this configuration:

1. Add `extends: ['@inrupt/eslint-config-react']` to your `.eslintrc.js` file.
1. Add the following line to the top of the `.eslintrc.js` file:

```js
require("@rushstack/eslint-patch/modern-module-resolution");
```

## Rules

Exhaustive documentation forthcoming. For now, the general principles are:

- Load a stylistic base set - in this case,
  [airbnb](https://www.npmjs.com/package/eslint-config-airbnb) and
  [airbnb/hooks](https://www.npmjs.com/package/eslint-config-airbnb-hooks)
- Load inrupt-base, which loads recommended configs for common libraries: eslint, jest, typescript,
  and prettier
- Do very little else- as few custom rules or overrides as possible.
- Some rules are updated to work with nextjs.

---
_Source: https://npm.io/package/@inrupt/eslint-config-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
