ESLint

Purpose

This package unifies the shared ESLint config used across all TanStack projects. It is designed to be framework-agnostic, and does not include any framework-specific plugins.

Setup

package.json

  • Make sure you have ESLint v8.57.0+ installed
  • We will upgrade to ESLint v9 once typescript-eslint v8 and eslint-plugin-react-hooks v5 release

eslint.config.js

js
import { tanstackConfig } from '@tanstack/config/eslint'

export default [
  ...tanstackConfig,
  {
    // Custom rules go here
  },
]
import { tanstackConfig } from '@tanstack/config/eslint'

export default [
  ...tanstackConfig,
  {
    // Custom rules go here
  },
]

Plugins

Rules

You can inspect the enabled rules by running pnpm dlx @eslint/config-inspector, or by browsing the source here. Each rule has a comment explaining why it is included in the shared config.

Subscribe to Bytes

Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.

Bytes

No spam. Unsubscribe at any time.