From 6a7a87410fd31586a6924b4a93c123e74be0d8a1 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:18:39 +1000 Subject: [PATCH 1/9] feat(eslint-plugin-query): Add flat config compatibility --- .../src/__tests__/configs.test.ts | 22 ++++++------ packages/eslint-plugin-query/src/configs.ts | 34 ------------------- .../src/configs/recommended.ts | 10 ++++++ packages/eslint-plugin-query/src/index.ts | 24 +++++++++++-- 4 files changed, 42 insertions(+), 48 deletions(-) delete mode 100644 packages/eslint-plugin-query/src/configs.ts create mode 100644 packages/eslint-plugin-query/src/configs/recommended.ts diff --git a/packages/eslint-plugin-query/src/__tests__/configs.test.ts b/packages/eslint-plugin-query/src/__tests__/configs.test.ts index ee73289f90..e47e50727d 100644 --- a/packages/eslint-plugin-query/src/__tests__/configs.test.ts +++ b/packages/eslint-plugin-query/src/__tests__/configs.test.ts @@ -1,19 +1,17 @@ import { describe, expect, it } from 'vitest' -import { configs } from '../configs' +import { recommended } from '../configs/recommended' -describe('configs', () => { +describe('recommended', () => { it('should match snapshot', () => { - expect(configs).toMatchInlineSnapshot(` + expect(recommended).toMatchInlineSnapshot(` { - "recommended": { - "plugins": [ - "@tanstack/eslint-plugin-query", - ], - "rules": { - "@tanstack/query/exhaustive-deps": "error", - "@tanstack/query/no-rest-destructuring": "warn", - "@tanstack/query/stable-query-client": "error", - }, + "plugins": [ + "@tanstack/eslint-plugin-query", + ], + "rules": { + "@tanstack/query/exhaustive-deps": "error", + "@tanstack/query/no-rest-destructuring": "warn", + "@tanstack/query/stable-query-client": "error", }, } `) diff --git a/packages/eslint-plugin-query/src/configs.ts b/packages/eslint-plugin-query/src/configs.ts deleted file mode 100644 index 12d23f0d5b..0000000000 --- a/packages/eslint-plugin-query/src/configs.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { rules } from './rules' -import type { ESLintUtils } from '@typescript-eslint/utils' -import type { ExtraRuleDocs } from './types' - -function generateRecommendedConfig( - allRules: Record< - string, - ESLintUtils.RuleModule< - string, - ReadonlyArray, - ExtraRuleDocs, - ESLintUtils.RuleListener - > - >, -) { - return Object.entries(allRules).reduce( - (memo, [name, rule]) => { - const { recommended } = rule.meta.docs || {} - - return { - ...memo, - ...(recommended ? { [`@tanstack/query/${name}`]: recommended } : {}), - } - }, - {} as Record, - ) -} - -export const configs = { - recommended: { - plugins: ['@tanstack/eslint-plugin-query'], - rules: generateRecommendedConfig(rules), - }, -} diff --git a/packages/eslint-plugin-query/src/configs/recommended.ts b/packages/eslint-plugin-query/src/configs/recommended.ts new file mode 100644 index 0000000000..fb96d2e040 --- /dev/null +++ b/packages/eslint-plugin-query/src/configs/recommended.ts @@ -0,0 +1,10 @@ +import type { ESLint } from 'eslint' + +export const recommended: ESLint.ConfigData = { + plugins: ['@tanstack/eslint-plugin-query'], + rules: { + '@tanstack/query/exhaustive-deps': 'error', + '@tanstack/query/no-rest-destructuring': 'warn', + '@tanstack/query/stable-query-client': 'error', + }, +} diff --git a/packages/eslint-plugin-query/src/index.ts b/packages/eslint-plugin-query/src/index.ts index eef4c020b5..70f52d26fd 100644 --- a/packages/eslint-plugin-query/src/index.ts +++ b/packages/eslint-plugin-query/src/index.ts @@ -1,2 +1,22 @@ -export { configs } from './configs' -export { rules } from './rules' +import { recommended } from './configs/recommended' +import { rules } from './rules' +import type { ESLint } from 'eslint' +import type { RuleModule } from '@typescript-eslint/utils/ts-eslint' + +type RuleKey = keyof typeof rules + +interface Plugin extends Omit { + rules: Record> +} + +const plugin: Plugin = { + meta: { + name: '@tanstack/eslint-plugin-query', + }, + configs: { + recommended, + }, + rules, +} + +export default plugin From 5d56965478427417054e9b9b3c504073b58195b0 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:27:25 +1000 Subject: [PATCH 2/9] Add flat/recommended --- .../src/configs/flatRecommended.ts | 11 +++++++++++ packages/eslint-plugin-query/src/index.ts | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 packages/eslint-plugin-query/src/configs/flatRecommended.ts diff --git a/packages/eslint-plugin-query/src/configs/flatRecommended.ts b/packages/eslint-plugin-query/src/configs/flatRecommended.ts new file mode 100644 index 0000000000..005d80a32b --- /dev/null +++ b/packages/eslint-plugin-query/src/configs/flatRecommended.ts @@ -0,0 +1,11 @@ +import type { Linter } from 'eslint' + +export const flatRecommended: Array = [ + { + rules: { + '@tanstack/query/exhaustive-deps': 'error', + '@tanstack/query/no-rest-destructuring': 'warn', + '@tanstack/query/stable-query-client': 'error', + }, + }, +] diff --git a/packages/eslint-plugin-query/src/index.ts b/packages/eslint-plugin-query/src/index.ts index 70f52d26fd..a92981f367 100644 --- a/packages/eslint-plugin-query/src/index.ts +++ b/packages/eslint-plugin-query/src/index.ts @@ -1,4 +1,5 @@ import { recommended } from './configs/recommended' +import { flatRecommended } from './configs/flatRecommended' import { rules } from './rules' import type { ESLint } from 'eslint' import type { RuleModule } from '@typescript-eslint/utils/ts-eslint' @@ -14,7 +15,8 @@ const plugin: Plugin = { name: '@tanstack/eslint-plugin-query', }, configs: { - recommended, + recommended: recommended, + 'flat/recommended': flatRecommended, }, rules, } From 76757c181938e494157d2e615e37caf217d0119d Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:30:50 +1000 Subject: [PATCH 3/9] Fix types --- packages/eslint-plugin-query/src/configs/flatRecommended.ts | 4 ++-- packages/eslint-plugin-query/src/configs/recommended.ts | 4 ++-- packages/eslint-plugin-query/src/index.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/eslint-plugin-query/src/configs/flatRecommended.ts b/packages/eslint-plugin-query/src/configs/flatRecommended.ts index 005d80a32b..43fa882867 100644 --- a/packages/eslint-plugin-query/src/configs/flatRecommended.ts +++ b/packages/eslint-plugin-query/src/configs/flatRecommended.ts @@ -1,6 +1,6 @@ import type { Linter } from 'eslint' -export const flatRecommended: Array = [ +export const flatRecommended = [ { rules: { '@tanstack/query/exhaustive-deps': 'error', @@ -8,4 +8,4 @@ export const flatRecommended: Array = [ '@tanstack/query/stable-query-client': 'error', }, }, -] +] satisfies Array diff --git a/packages/eslint-plugin-query/src/configs/recommended.ts b/packages/eslint-plugin-query/src/configs/recommended.ts index fb96d2e040..51ebac2f60 100644 --- a/packages/eslint-plugin-query/src/configs/recommended.ts +++ b/packages/eslint-plugin-query/src/configs/recommended.ts @@ -1,10 +1,10 @@ import type { ESLint } from 'eslint' -export const recommended: ESLint.ConfigData = { +export const recommended = { plugins: ['@tanstack/eslint-plugin-query'], rules: { '@tanstack/query/exhaustive-deps': 'error', '@tanstack/query/no-rest-destructuring': 'warn', '@tanstack/query/stable-query-client': 'error', }, -} +} satisfies ESLint.ConfigData diff --git a/packages/eslint-plugin-query/src/index.ts b/packages/eslint-plugin-query/src/index.ts index a92981f367..260cddf7ed 100644 --- a/packages/eslint-plugin-query/src/index.ts +++ b/packages/eslint-plugin-query/src/index.ts @@ -10,7 +10,7 @@ interface Plugin extends Omit { rules: Record> } -const plugin: Plugin = { +const plugin = { meta: { name: '@tanstack/eslint-plugin-query', }, @@ -19,6 +19,6 @@ const plugin: Plugin = { 'flat/recommended': flatRecommended, }, rules, -} +} satisfies Plugin export default plugin From 2443a095b7023e2489a50d4b9b6db8822293f945 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:33:25 +1000 Subject: [PATCH 4/9] Use in basic-typescript --- examples/react/basic-graphql-request/src/index.jsx | 1 - examples/react/basic-typescript/.eslintrc | 7 ------- examples/react/basic-typescript/eslint.config.js | 12 ++++++++++++ examples/react/basic-typescript/src/index.tsx | 1 - examples/react/basic-typescript/tsconfig.json | 2 +- examples/react/basic/src/index.jsx | 1 - examples/react/default-query-function/src/index.jsx | 1 - examples/react/simple/src/index.jsx | 1 - 8 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 examples/react/basic-typescript/.eslintrc create mode 100644 examples/react/basic-typescript/eslint.config.js diff --git a/examples/react/basic-graphql-request/src/index.jsx b/examples/react/basic-graphql-request/src/index.jsx index b484d73a23..10aad56931 100644 --- a/examples/react/basic-graphql-request/src/index.jsx +++ b/examples/react/basic-graphql-request/src/index.jsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/anchor-is-valid */ import React from 'react' import ReactDOM from 'react-dom/client' import { diff --git a/examples/react/basic-typescript/.eslintrc b/examples/react/basic-typescript/.eslintrc deleted file mode 100644 index 270fbc9ac0..0000000000 --- a/examples/react/basic-typescript/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": [ - "plugin:react/jsx-runtime", - "plugin:react-hooks/recommended", - "plugin:@tanstack/eslint-plugin-query/recommended" - ] -} diff --git a/examples/react/basic-typescript/eslint.config.js b/examples/react/basic-typescript/eslint.config.js new file mode 100644 index 0000000000..f2dcabef79 --- /dev/null +++ b/examples/react/basic-typescript/eslint.config.js @@ -0,0 +1,12 @@ +import pluginQuery from '@tanstack/eslint-plugin-query' +import rootConfig from '../../../eslint.config.js' + +export default [ + ...rootConfig, + ...pluginQuery.configs['flat/recommended'], + { + plugins: { + '@tanstack/query': pluginQuery, + }, + }, +] diff --git a/examples/react/basic-typescript/src/index.tsx b/examples/react/basic-typescript/src/index.tsx index 09d700c7c1..d6aace092c 100644 --- a/examples/react/basic-typescript/src/index.tsx +++ b/examples/react/basic-typescript/src/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/anchor-is-valid */ import * as React from 'react' import ReactDOM from 'react-dom/client' import axios from 'axios' diff --git a/examples/react/basic-typescript/tsconfig.json b/examples/react/basic-typescript/tsconfig.json index 7c962d9747..23a8707ef4 100644 --- a/examples/react/basic-typescript/tsconfig.json +++ b/examples/react/basic-typescript/tsconfig.json @@ -20,5 +20,5 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": ["src"] + "include": ["src", "eslint.config.js"] } diff --git a/examples/react/basic/src/index.jsx b/examples/react/basic/src/index.jsx index e038ea9b33..3ee4ac23a8 100644 --- a/examples/react/basic/src/index.jsx +++ b/examples/react/basic/src/index.jsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/anchor-is-valid */ import React from 'react' import ReactDOM from 'react-dom/client' import axios from 'axios' diff --git a/examples/react/default-query-function/src/index.jsx b/examples/react/default-query-function/src/index.jsx index 5b494df68e..6a10ce9155 100644 --- a/examples/react/default-query-function/src/index.jsx +++ b/examples/react/default-query-function/src/index.jsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/anchor-is-valid */ import React from 'react' import ReactDOM from 'react-dom/client' import axios from 'axios' diff --git a/examples/react/simple/src/index.jsx b/examples/react/simple/src/index.jsx index 5aa4579fe7..fa7f86a58a 100644 --- a/examples/react/simple/src/index.jsx +++ b/examples/react/simple/src/index.jsx @@ -1,4 +1,3 @@ -/* eslint-disable jsx-a11y/anchor-is-valid */ import React from 'react' import ReactDOM from 'react-dom/client' import { From 4d9d043d7beba543c58d22d26585ab603736a03d Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:40:13 +1000 Subject: [PATCH 5/9] Load plugin with flat/recommended --- .../react/basic-typescript/eslint.config.js | 10 +---- .../src/configs/flatRecommended.ts | 11 ----- .../src/configs/recommended.ts | 10 ----- packages/eslint-plugin-query/src/index.ts | 41 +++++++++++++++---- 4 files changed, 33 insertions(+), 39 deletions(-) delete mode 100644 packages/eslint-plugin-query/src/configs/flatRecommended.ts delete mode 100644 packages/eslint-plugin-query/src/configs/recommended.ts diff --git a/examples/react/basic-typescript/eslint.config.js b/examples/react/basic-typescript/eslint.config.js index f2dcabef79..1056f178d8 100644 --- a/examples/react/basic-typescript/eslint.config.js +++ b/examples/react/basic-typescript/eslint.config.js @@ -1,12 +1,4 @@ import pluginQuery from '@tanstack/eslint-plugin-query' import rootConfig from '../../../eslint.config.js' -export default [ - ...rootConfig, - ...pluginQuery.configs['flat/recommended'], - { - plugins: { - '@tanstack/query': pluginQuery, - }, - }, -] +export default [...rootConfig, ...pluginQuery.configs['flat/recommended']] diff --git a/packages/eslint-plugin-query/src/configs/flatRecommended.ts b/packages/eslint-plugin-query/src/configs/flatRecommended.ts deleted file mode 100644 index 43fa882867..0000000000 --- a/packages/eslint-plugin-query/src/configs/flatRecommended.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Linter } from 'eslint' - -export const flatRecommended = [ - { - rules: { - '@tanstack/query/exhaustive-deps': 'error', - '@tanstack/query/no-rest-destructuring': 'warn', - '@tanstack/query/stable-query-client': 'error', - }, - }, -] satisfies Array diff --git a/packages/eslint-plugin-query/src/configs/recommended.ts b/packages/eslint-plugin-query/src/configs/recommended.ts deleted file mode 100644 index 51ebac2f60..0000000000 --- a/packages/eslint-plugin-query/src/configs/recommended.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { ESLint } from 'eslint' - -export const recommended = { - plugins: ['@tanstack/eslint-plugin-query'], - rules: { - '@tanstack/query/exhaustive-deps': 'error', - '@tanstack/query/no-rest-destructuring': 'warn', - '@tanstack/query/stable-query-client': 'error', - }, -} satisfies ESLint.ConfigData diff --git a/packages/eslint-plugin-query/src/index.ts b/packages/eslint-plugin-query/src/index.ts index 260cddf7ed..9a8e387b20 100644 --- a/packages/eslint-plugin-query/src/index.ts +++ b/packages/eslint-plugin-query/src/index.ts @@ -1,24 +1,47 @@ -import { recommended } from './configs/recommended' -import { flatRecommended } from './configs/flatRecommended' import { rules } from './rules' -import type { ESLint } from 'eslint' +import type { ESLint, Linter } from 'eslint' import type { RuleModule } from '@typescript-eslint/utils/ts-eslint' type RuleKey = keyof typeof rules interface Plugin extends Omit { rules: Record> + configs: Record< + string, + ESLint.ConfigData | Linter.FlatConfig | Array + > } -const plugin = { +const plugin: Plugin = { meta: { name: '@tanstack/eslint-plugin-query', }, - configs: { - recommended: recommended, - 'flat/recommended': flatRecommended, - }, + configs: {}, rules, -} satisfies Plugin +} + +// Assign configs here so we can reference `plugin` +Object.assign(plugin.configs, { + recommended: { + plugins: ['@tanstack/eslint-plugin-query'], + rules: { + '@tanstack/query/exhaustive-deps': 'error', + '@tanstack/query/no-rest-destructuring': 'warn', + '@tanstack/query/stable-query-client': 'error', + }, + }, + 'flat/recommended': [ + { + plugins: { + '@tanstack/query': plugin, + }, + rules: { + '@tanstack/query/exhaustive-deps': 'error', + '@tanstack/query/no-rest-destructuring': 'warn', + '@tanstack/query/stable-query-client': 'error', + }, + }, + ], +}) export default plugin From 94d6be6b0c42f1b99c485e58a135687f9d47cc86 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:49:55 +1000 Subject: [PATCH 6/9] Update docs --- docs/eslint/eslint-plugin-query.md | 60 +++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/docs/eslint/eslint-plugin-query.md b/docs/eslint/eslint-plugin-query.md index 661943b8b9..d54006654e 100644 --- a/docs/eslint/eslint-plugin-query.md +++ b/docs/eslint/eslint-plugin-query.md @@ -19,34 +19,68 @@ $ yarn add -D @tanstack/eslint-plugin-query $ bun add -D @tanstack/eslint-plugin-query ``` -## Usage +## Flat Config (`eslint.config.js`) -To enable all of the recommended rules for our plugin, add `plugin:@tanstack/eslint-plugin-query/recommended` in extends: +### Recommended setup -```json -{ - "extends": ["plugin:@tanstack/eslint-plugin-query/recommended"] -} +To enable all of the recommended rules for our plugin, add the following config: + +```js +import pluginQuery from '@tanstack/eslint-plugin-query' + +export default [ + ...pluginQuery.configs['flat/recommended'], + // Any other config... +] +``` + +### Custom setup + +Alternatively, you can load the plugin and configure only the rules you want to use: + +```js +import pluginQuery from '@tanstack/eslint-plugin-query' + +export default [ + { + plugins: { + '@tanstack/query': pluginQuery, + }, + rules: { + '@tanstack/query/exhaustive-deps': 'error', + }, + }, + // Any other config... +] ``` -### Alternative config +## Legacy Config (`.eslintrc`) -Alternatively, add `@tanstack/eslint-plugin-query` to the plugins section of your `.eslintrc` configuration file: +### Recommended setup + +To enable all of the recommended rules for our plugin, add `plugin:@tanstack/eslint-plugin-query/recommended` in extends: ```json { - "plugins": ["@tanstack/query"] + "extends": ["plugin:@tanstack/eslint-plugin-query/recommended"] } ``` -Then configure the rules you want to use under the rules section: +### Custom setup + +Alternatively, add `@tanstack/eslint-plugin-query` to the plugins section, and configure the rules you want to use: ```json { + "plugins": ["@tanstack/query"], "rules": { - "@tanstack/query/exhaustive-deps": "error", - "@tanstack/query/no-rest-destructuring": "warn", - "@tanstack/query/stable-query-client": "error" + "@tanstack/query/exhaustive-deps": "error" } } ``` + +## Rules + +- [@tanstack/query/exhaustive-deps](../exhaustive-deps) +- [@tanstack/query/no-rest-destructuring](../exhaustive-deps) +- [@tanstack/query/stable-query-client](../exhaustive-deps) From 9760cd60d19f1142aa9b18f9c045724a9a724b83 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:55:53 +1000 Subject: [PATCH 7/9] Add react and react-hooks back --- .../react/basic-typescript/eslint.config.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/examples/react/basic-typescript/eslint.config.js b/examples/react/basic-typescript/eslint.config.js index 1056f178d8..30f7018c31 100644 --- a/examples/react/basic-typescript/eslint.config.js +++ b/examples/react/basic-typescript/eslint.config.js @@ -1,4 +1,19 @@ import pluginQuery from '@tanstack/eslint-plugin-query' +import pluginReact from '@eslint-react/eslint-plugin' +import pluginReactHooks from 'eslint-plugin-react-hooks' import rootConfig from '../../../eslint.config.js' -export default [...rootConfig, ...pluginQuery.configs['flat/recommended']] +export default [ + ...rootConfig, + ...pluginQuery.configs['flat/recommended'], + pluginReact.configs.recommended, + { + plugins: { + 'react-hooks': pluginReactHooks, + }, + rules: { + 'react-hooks/exhaustive-deps': 'error', + 'react-hooks/rules-of-hooks': 'error', + }, + }, +] From 98f10bc7e0b97bfa93358d701192e48b8b36f4ec Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 09:56:53 +1000 Subject: [PATCH 8/9] Remove test --- .../src/__tests__/configs.test.ts | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 packages/eslint-plugin-query/src/__tests__/configs.test.ts diff --git a/packages/eslint-plugin-query/src/__tests__/configs.test.ts b/packages/eslint-plugin-query/src/__tests__/configs.test.ts deleted file mode 100644 index e47e50727d..0000000000 --- a/packages/eslint-plugin-query/src/__tests__/configs.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { recommended } from '../configs/recommended' - -describe('recommended', () => { - it('should match snapshot', () => { - expect(recommended).toMatchInlineSnapshot(` - { - "plugins": [ - "@tanstack/eslint-plugin-query", - ], - "rules": { - "@tanstack/query/exhaustive-deps": "error", - "@tanstack/query/no-rest-destructuring": "warn", - "@tanstack/query/stable-query-client": "error", - }, - } - `) - }) -}) From 6928cb882b529d788745e01a77dee54bc6388104 Mon Sep 17 00:00:00 2001 From: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com> Date: Wed, 3 Jul 2024 10:10:09 +1000 Subject: [PATCH 9/9] Fix attw --- examples/react/basic-typescript/eslint.config.js | 4 ++-- package.json | 2 +- packages/eslint-plugin-query/.attw.json | 3 +++ pnpm-lock.yaml | 11 ++++++----- 4 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 packages/eslint-plugin-query/.attw.json diff --git a/examples/react/basic-typescript/eslint.config.js b/examples/react/basic-typescript/eslint.config.js index 30f7018c31..dee0fcc96c 100644 --- a/examples/react/basic-typescript/eslint.config.js +++ b/examples/react/basic-typescript/eslint.config.js @@ -1,10 +1,10 @@ +import { tanstackConfig } from '@tanstack/config/eslint' import pluginQuery from '@tanstack/eslint-plugin-query' import pluginReact from '@eslint-react/eslint-plugin' import pluginReactHooks from 'eslint-plugin-react-hooks' -import rootConfig from '../../../eslint.config.js' export default [ - ...rootConfig, + ...tanstackConfig, ...pluginQuery.configs['flat/recommended'], pluginReact.configs.recommended, { diff --git a/package.json b/package.json index 0de7e54ea3..bf098199a9 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ }, "namespace": "@tanstack", "devDependencies": { - "@arethetypeswrong/cli": "^0.15.3", + "@arethetypeswrong/cli": "^0.16.0", "@cspell/eslint-plugin": "^8.9.1", "@eslint-react/eslint-plugin": "^1.5.16", "@solidjs/testing-library": "^0.8.8", diff --git a/packages/eslint-plugin-query/.attw.json b/packages/eslint-plugin-query/.attw.json new file mode 100644 index 0000000000..329bfe8343 --- /dev/null +++ b/packages/eslint-plugin-query/.attw.json @@ -0,0 +1,3 @@ +{ + "ignoreRules": ["false-export-default"] +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f9efa7436..f12e7a998c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ importers: .: devDependencies: '@arethetypeswrong/cli': - specifier: ^0.15.3 - version: 0.15.3 + specifier: ^0.16.0 + version: 0.16.0 '@cspell/eslint-plugin': specifier: ^8.9.1 version: 8.9.1(eslint@8.57.0) @@ -2546,8 +2546,8 @@ packages: peerDependencies: ajv: '>=8' - '@arethetypeswrong/cli@0.15.3': - resolution: {integrity: sha512-sIMA9ZJBWDEg1+xt5RkAEflZuf8+PO8SdKj17x6PtETuUho+qlZJg4DgmKc3q+QwQ9zOB5VLK6jVRbFdNLdUIA==} + '@arethetypeswrong/cli@0.16.0': + resolution: {integrity: sha512-Vn3ihwlhueIvyJ6V3PKS8zwll9TId5Radvl3GS58ITimafJNoYRribKCoymYFiFS3jH6TspM30KhhiMvnMGvNQ==} engines: {node: '>=18'} hasBin: true @@ -19053,7 +19053,7 @@ snapshots: jsonpointer: 5.0.1 leven: 3.1.0 - '@arethetypeswrong/cli@0.15.3': + '@arethetypeswrong/cli@0.16.0': dependencies: '@arethetypeswrong/core': 0.15.1 chalk: 4.1.2 @@ -19062,6 +19062,7 @@ snapshots: marked: 9.1.6 marked-terminal: 6.2.0(marked@9.1.6) semver: 7.6.2 + which-pm-runs: 1.1.0 '@arethetypeswrong/core@0.15.1': dependencies: