Skip to content
Source
Sign inSign up
TanStack/config
Open History to see the last commit

eslint.md

40 lines1.2 KB

1---
2id: eslint
3title: ESLint
4---
5​
6## Purpose
7​
8This 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.
9​
10## Setup
11​
12### package.json
13​
14- Make sure you have ESLint v9+ installed
15​
16### eslint.config.js
17​
18```js
19import { tanstackConfig } from '@tanstack/eslint-config'
20// OR
21import { tanstackConfig } from '@tanstack/config/eslint'
22​
23export default [
24 ...tanstackConfig,
25 {
26 // Custom rules go here
27 },
29```
30​
31## Plugins
32​
33- [@eslint/js](https://github.com/eslint/eslint) - The core ESLint rules
34- [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) - Enables TypeScript support
35- [eslint-plugin-import-x](https://github.com/un-ts/eslint-plugin-import-x) - Lints imports and exports
36- [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) - Useful rules for Node.js
37​
38## Rules
39​
40You can inspect the enabled rules by running `pnpm dlx @eslint/config-inspector`, or by browsing the source [here](https://github.com/TanStack/config/tree/main/packages/eslint-config). Each rule has a comment explaining why it is included in the shared config.