Skip to content

feat(eslint): add type-checked configuration for eslint plugin - #8966

Open
Newbie012 wants to merge 6 commits into
mainfrom
feat-eslint-type-checked-configuration
Open

feat(eslint): add type-checked configuration for eslint plugin#8966
Newbie012 wants to merge 6 commits into
mainfrom
feat-eslint-type-checked-configuration

Conversation

@Newbie012

Copy link
Copy Markdown
Contributor

Created a new configuration for type-checked rules in the ESLint plugin. Added a flat/recommendedTypeChecked config that includes the no-void-query-fn rule which requires TypeScript type information. Added an example project demonstrating the type-checked ESLint setup and updated the documentation to explain how to use it.

Created a new configuration for type-checked rules in the ESLint plugin. Added a `flat/recommendedTypeChecked` config that includes the `no-void-query-fn` rule which requires TypeScript type information. Added an example project demonstrating the type-checked ESLint setup and updated the documentation to explain how to use it.
@Newbie012
Newbie012 requested a review from CopilotApril 7, 2025 09:44
@github-actionsgithub-actionsBot added documentation Improvements or additions to documentation package: eslint-plugin-query labels Apr 7, 2025

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 10 out of 15 changed files in this pull request and generated no comments.

Files not reviewed (5)
  • examples/react/eslint-type-checked/.gitignore: Language not supported
  • examples/react/eslint-type-checked/index.html: Language not supported
  • examples/react/eslint-type-checked/package.json: Language not supported
  • examples/react/eslint-type-checked/tsconfig.json: Language not supported
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

packages/eslint-plugin-query/src/tests/no-void-query-fn.test.ts:11

  • [nitpick] The naming of 'ruleTesterTypeChecked' versus the later 'ruleTester' may be confusing. Consider using consistently descriptive names to clearly differentiate tests for type-checked and non-type-checked scenarios.
const ruleTesterTypeChecked = new RuleTester({

examples/react/eslint-type-checked/eslint.config.js:15

  • Verify that 'projectService' is the correct parser option to enable type-aware linting, as standard configurations often use the 'project' property. If this is a mistake, updating it may help ensure proper type-checking.
projectService: true,

@nx-cloud

nx-cloudBot commented Apr 7, 2025

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 26f5908.

CommandStatusDurationResult
nx affected --targets=test:sherif,test:knip,tes...✅ Succeeded51sView ↗
nx run-many --target=build --exclude=examples/*...✅ Succeeded2sView ↗

☁️ Nx Cloud last updated this comment at 2025-04-07 16:42:59 UTC

@pkg-pr-new

pkg-pr-newBot commented Apr 7, 2025

Copy link
Copy Markdown
More templates

@tanstack/angular-query-devtools-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8966

@tanstack/angular-query-experimental

npm i https://pkg.pr.new/@tanstack/angular-query-experimental@8966

@tanstack/query-async-storage-persister

npm i https://pkg.pr.new/@tanstack/query-async-storage-persister@8966

@tanstack/query-broadcast-client-experimental

npm i https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8966

@tanstack/eslint-plugin-query

npm i https://pkg.pr.new/@tanstack/eslint-plugin-query@8966

@tanstack/query-core

npm i https://pkg.pr.new/@tanstack/query-core@8966

@tanstack/query-devtools

npm i https://pkg.pr.new/@tanstack/query-devtools@8966

@tanstack/query-persist-client-core

npm i https://pkg.pr.new/@tanstack/query-persist-client-core@8966

@tanstack/query-sync-storage-persister

npm i https://pkg.pr.new/@tanstack/query-sync-storage-persister@8966

@tanstack/react-query

npm i https://pkg.pr.new/@tanstack/react-query@8966

@tanstack/react-query-devtools

npm i https://pkg.pr.new/@tanstack/react-query-devtools@8966

@tanstack/react-query-next-experimental

npm i https://pkg.pr.new/@tanstack/react-query-next-experimental@8966

@tanstack/react-query-persist-client

npm i https://pkg.pr.new/@tanstack/react-query-persist-client@8966

@tanstack/solid-query

npm i https://pkg.pr.new/@tanstack/solid-query@8966

@tanstack/solid-query-devtools

npm i https://pkg.pr.new/@tanstack/solid-query-devtools@8966

@tanstack/solid-query-persist-client

npm i https://pkg.pr.new/@tanstack/solid-query-persist-client@8966

@tanstack/svelte-query

npm i https://pkg.pr.new/@tanstack/svelte-query@8966

@tanstack/svelte-query-devtools

npm i https://pkg.pr.new/@tanstack/svelte-query-devtools@8966

@tanstack/svelte-query-persist-client

npm i https://pkg.pr.new/@tanstack/svelte-query-persist-client@8966

@tanstack/vue-query

npm i https://pkg.pr.new/@tanstack/vue-query@8966

@tanstack/vue-query-devtools

npm i https://pkg.pr.new/@tanstack/vue-query-devtools@8966

commit: 26f5908

@github-actions

github-actionsBot commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

Sizes for commit 26f5908:

BranchBundle Size
Main
This PR

@Newbie012

Copy link
Copy Markdown
ContributorAuthor

@TkDodo I think something is off with the current nx configuration. It seems like test:lib actually depends on build rather than compile. As you can see in the failing CI, some of the pacakges failed to test:lib since they weren't able to import from query-core (since it was only compiled rather than build)

@TkDodo

Copy link
Copy Markdown
Collaborator

It seems like test:lib actually depends on build rather than compile

yes, we are aware and working on it.

@TkDodo

Copy link
Copy Markdown
Collaborator

@Newbie012 I’ve temporarily set build as a dependency for test:lib to work around this problem.

@codecov

codecovBot commented Apr 7, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.30%. Comparing base (97c8d84) to head (26f5908).
⚠️ Report is 821 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@ Coverage Diff @@## main #8966 +/- ##
=======================================
Coverage 44.30% 44.30% =======================================
Files 202 202 Lines 8058 8060 +2 Branches 1784 1776 -8 =======================================
+ Hits 3570 3571 +1 - Misses 4060 4061 +1 
Partials 428 428 
ComponentsCoverage Δ
@tanstack/angular-query-devtools-experimental∅ <ø> (∅)
@tanstack/angular-query-experimental88.08% <ø> (ø)
@tanstack/eslint-plugin-query88.05% <33.33%> (-0.15%)⬇️
@tanstack/query-async-storage-persister43.85% <ø> (ø)
@tanstack/query-broadcast-client-experimental∅ <ø> (∅)
@tanstack/query-codemods0.00% <ø> (ø)
@tanstack/query-core94.77% <ø> (ø)
@tanstack/query-devtools3.61% <ø> (ø)
@tanstack/query-persist-client-core57.73% <ø> (ø)
@tanstack/query-sync-storage-persister84.61% <ø> (ø)
@tanstack/react-query95.42% <ø> (ø)
@tanstack/react-query-devtools10.00% <ø> (ø)
@tanstack/react-query-next-experimental∅ <ø> (∅)
@tanstack/react-query-persist-client100.00% <ø> (ø)
@tanstack/solid-query78.48% <ø> (ø)
@tanstack/solid-query-devtools∅ <ø> (∅)
@tanstack/solid-query-persist-client100.00% <ø> (ø)
@tanstack/svelte-query88.15% <ø> (ø)
@tanstack/svelte-query-devtools∅ <ø> (∅)
@tanstack/svelte-query-persist-client100.00% <ø> (ø)
@tanstack/vue-query71.01% <ø> (ø)
@tanstack/vue-query-devtools∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codecov-commenter

codecov-commenter commented May 27, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.30%. Comparing base (97c8d84) to head (26f5908).
⚠️ Report is 1176 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@ Coverage Diff @@## main #8966 +/- ##
=======================================
Coverage 44.30% 44.30% =======================================
Files 202 202 Lines 8058 8060 +2 Branches 1784 1776 -8 =======================================
+ Hits 3570 3571 +1 - Misses 4060 4061 +1 
Partials 428 428 
ComponentsCoverage Δ
@tanstack/angular-query-devtools-experimental∅ <ø> (∅)
@tanstack/angular-query-experimental88.08% <ø> (ø)
@tanstack/eslint-plugin-query88.05% <33.33%> (-0.15%)⬇️
@tanstack/query-async-storage-persister43.85% <ø> (ø)
@tanstack/query-broadcast-client-experimental∅ <ø> (∅)
@tanstack/query-codemods0.00% <ø> (ø)
@tanstack/query-core94.77% <ø> (ø)
@tanstack/query-devtools3.61% <ø> (ø)
@tanstack/query-persist-client-core57.73% <ø> (ø)
@tanstack/query-sync-storage-persister84.61% <ø> (ø)
@tanstack/react-query95.42% <ø> (ø)
@tanstack/react-query-devtools10.00% <ø> (ø)
@tanstack/react-query-next-experimental∅ <ø> (∅)
@tanstack/react-query-persist-client100.00% <ø> (ø)
@tanstack/solid-query78.48% <ø> (ø)
@tanstack/solid-query-devtools∅ <ø> (∅)
@tanstack/solid-query-persist-client100.00% <ø> (ø)
@tanstack/svelte-query88.15% <ø> (ø)
@tanstack/svelte-query-devtools∅ <ø> (∅)
@tanstack/svelte-query-persist-client100.00% <ø> (ø)
@tanstack/vue-query71.01% <ø> (ø)
@tanstack/vue-query-devtools∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationpackage: eslint-plugin-query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Newbie012@TkDodo@codecov-commenter