Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(eslint-config): typescript-eslint 8 #1326

Merged
merged 11 commits into from
Oct 20, 2024
Merged

feat(eslint-config): typescript-eslint 8 #1326

merged 11 commits into from
Oct 20, 2024

Conversation

SEOKKAMONI
Copy link
Collaborator

@SEOKKAMONI SEOKKAMONI commented Oct 18, 2024

Overview

related #1240

PR Checklist

  • I did below actions if need
  1. I read the Contributing Guide
  2. I added documents and tests.

@SEOKKAMONI SEOKKAMONI self-assigned this Oct 18, 2024
Copy link

changeset-bot bot commented Oct 18, 2024

⚠️ No Changeset found

Latest commit: db08a1a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Oct 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2024 3:54pm
v1.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2024 3:54pm
visualization.suspensive.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2024 3:54pm

Copy link

github-actions bot commented Oct 19, 2024

Size Change: 0 B

Total Size: 64.2 kB

Filename Size Change
packages/react/dist/ErrorBoundary.js 206 B +1 B (+0.49%)
packages/react/dist/ErrorBoundaryGroup.js 196 B +1 B (+0.51%)
packages/react/dist/wrap.js 208 B -2 B (-0.95%)
ℹ️ View Unchanged
Filename Size
packages/jotai/dist/Atom.cjs 660 B
packages/jotai/dist/Atom.js 115 B
packages/jotai/dist/AtomValue.cjs 647 B
packages/jotai/dist/AtomValue.js 120 B
packages/jotai/dist/index.cjs 755 B
packages/jotai/dist/index.js 158 B
packages/jotai/dist/SetAtom.cjs 645 B
packages/jotai/dist/SetAtom.js 118 B
packages/react-dom/dist/index.cjs 2.11 kB
packages/react-dom/dist/index.js 139 B
packages/react-dom/dist/InView.cjs 2.1 kB
packages/react-dom/dist/InView.js 130 B
packages/react-dom/dist/useInView.cjs 1.87 kB
packages/react-dom/dist/useInView.js 120 B
packages/react-native/dist/index.cjs 619 B
packages/react-native/dist/index.js 122 B
packages/react-native/dist/TestText.cjs 612 B
packages/react-native/dist/TestText.js 119 B
packages/react-query-4/dist/index.cjs 1.86 kB
packages/react-query-4/dist/index.js 393 B
packages/react-query-4/dist/infiniteQueryOptions.cjs 548 B
packages/react-query-4/dist/infiniteQueryOptions.js 144 B
packages/react-query-4/dist/Mutation.cjs 821 B
packages/react-query-4/dist/Mutation.js 132 B
packages/react-query-4/dist/PrefetchInfiniteQuery.cjs 722 B
packages/react-query-4/dist/PrefetchInfiniteQuery.js 155 B
packages/react-query-4/dist/PrefetchQuery.cjs 712 B
packages/react-query-4/dist/PrefetchQuery.js 146 B
packages/react-query-4/dist/QueryClientConsumer.cjs 665 B
packages/react-query-4/dist/QueryClientConsumer.js 139 B
packages/react-query-4/dist/QueryErrorBoundary.cjs 1.12 kB
packages/react-query-4/dist/QueryErrorBoundary.js 142 B
packages/react-query-4/dist/queryOptions.cjs 540 B
packages/react-query-4/dist/queryOptions.js 136 B
packages/react-query-4/dist/SuspenseInfiniteQuery.cjs 1.05 kB
packages/react-query-4/dist/SuspenseInfiniteQuery.js 155 B
packages/react-query-4/dist/SuspenseQueries.cjs 923 B
packages/react-query-4/dist/SuspenseQueries.js 149 B
packages/react-query-4/dist/SuspenseQuery.cjs 1.04 kB
packages/react-query-4/dist/SuspenseQuery.js 147 B
packages/react-query-4/dist/usePrefetchInfiniteQuery.cjs 648 B
packages/react-query-4/dist/usePrefetchInfiniteQuery.js 148 B
packages/react-query-4/dist/usePrefetchQuery.cjs 639 B
packages/react-query-4/dist/usePrefetchQuery.js 140 B
packages/react-query-4/dist/useSuspenseInfiniteQuery.cjs 833 B
packages/react-query-4/dist/useSuspenseInfiniteQuery.js 148 B
packages/react-query-4/dist/useSuspenseQueries.cjs 833 B
packages/react-query-4/dist/useSuspenseQueries.js 142 B
packages/react-query-4/dist/useSuspenseQuery.cjs 824 B
packages/react-query-4/dist/useSuspenseQuery.js 140 B
packages/react-query-5/dist/index.cjs 1.76 kB
packages/react-query-5/dist/index.js 392 B
packages/react-query-5/dist/infiniteQueryOptions.cjs 573 B
packages/react-query-5/dist/infiniteQueryOptions.js 144 B
packages/react-query-5/dist/Mutation.cjs 821 B
packages/react-query-5/dist/Mutation.js 132 B
packages/react-query-5/dist/PrefetchInfiniteQuery.cjs 647 B
packages/react-query-5/dist/PrefetchInfiniteQuery.js 145 B
packages/react-query-5/dist/PrefetchQuery.cjs 639 B
packages/react-query-5/dist/PrefetchQuery.js 137 B
packages/react-query-5/dist/QueryClientConsumer.cjs 663 B
packages/react-query-5/dist/QueryClientConsumer.js 140 B
packages/react-query-5/dist/QueryErrorBoundary.cjs 1.12 kB
packages/react-query-5/dist/QueryErrorBoundary.js 142 B
packages/react-query-5/dist/queryOptions.cjs 563 B
packages/react-query-5/dist/queryOptions.js 136 B
packages/react-query-5/dist/SuspenseInfiniteQuery.cjs 833 B
packages/react-query-5/dist/SuspenseInfiniteQuery.js 145 B
packages/react-query-5/dist/SuspenseQueries.cjs 671 B
packages/react-query-5/dist/SuspenseQueries.js 139 B
packages/react-query-5/dist/SuspenseQuery.cjs 825 B
packages/react-query-5/dist/SuspenseQuery.js 137 B
packages/react-query-5/dist/usePrefetchInfiniteQuery.cjs 577 B
packages/react-query-5/dist/usePrefetchInfiniteQuery.js 148 B
packages/react-query-5/dist/usePrefetchQuery.cjs 569 B
packages/react-query-5/dist/usePrefetchQuery.js 140 B
packages/react-query-5/dist/useSuspenseInfiniteQuery.cjs 577 B
packages/react-query-5/dist/useSuspenseInfiniteQuery.js 148 B
packages/react-query-5/dist/useSuspenseQueries.cjs 571 B
packages/react-query-5/dist/useSuspenseQueries.js 142 B
packages/react-query-5/dist/useSuspenseQuery.cjs 569 B
packages/react-query-5/dist/useSuspenseQuery.js 140 B
packages/react-query/dist/index.cjs 551 B
packages/react-query/dist/index.js 121 B
packages/react-query/dist/v4.cjs 550 B
packages/react-query/dist/v4.js 116 B
packages/react-query/dist/v5.cjs 550 B
packages/react-query/dist/v5.js 116 B
packages/react/dist/ClientOnly.cjs 734 B
packages/react/dist/ClientOnly.js 141 B
packages/react/dist/DefaultProps.cjs 1.05 kB
packages/react/dist/DefaultProps.js 167 B
packages/react/dist/Delay.cjs 1.23 kB
packages/react/dist/Delay.js 159 B
packages/react/dist/DevMode.cjs 530 B
packages/react/dist/DevMode.js 131 B
packages/react/dist/ErrorBoundary.cjs 2.74 kB
packages/react/dist/ErrorBoundaryGroup.cjs 1.38 kB
packages/react/dist/index.cjs 4.33 kB
packages/react/dist/index.js 367 B
packages/react/dist/Suspense.cjs 1.29 kB
packages/react/dist/Suspense.js 172 B
packages/react/dist/Suspensive.cjs 1.26 kB
packages/react/dist/Suspensive.js 175 B
packages/react/dist/wrap.cjs 3.78 kB

compressed-size-action

Copy link

codspeed-hq bot commented Oct 19, 2024

CodSpeed Performance Report

Merging #1326 will create unknown performance changes

Comparing feat/ts-eslint (db08a1a) with main (c906edb)

Summary

⚠️ No benchmarks were detected in both the base of the PR and the PR.

@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.69%. Comparing base (c906edb) to head (db08a1a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1326      +/-   ##
==========================================
- Coverage   76.73%   76.69%   -0.05%     
==========================================
  Files          64       63       -1     
  Lines         503      502       -1     
  Branches      111      111              
==========================================
- Hits          386      385       -1     
  Misses        111      111              
  Partials        6        6              
Components Coverage Δ
@suspensive/react 100.00% <ø> (ø)
@suspensive/react-dom 100.00% <ø> (ø)
@suspensive/react-native 100.00% <ø> (ø)
@suspensive/react-query 72.86% <ø> (-0.21%) ⬇️
@suspensive/react-query-4 0.00% <ø> (ø)
@suspensive/react-query-5 0.00% <ø> (ø)
@suspensive/jotai 0.00% <ø> (ø)

@@ -13,6 +13,7 @@ const FALLBACK_GLOBAL = 'FALLBACK_GLOBAL'
describe('<SuspensiveProvider/>', () => {
it('should provide default ms prop of Delay', async () => {
render(
// eslint-disable-next-line @typescript-eslint/no-deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion)
This PR adds this eslint-disable-next-line in several locations.
How about having it at 'warn' level so we can pass CI and no need to have so many eslint-disables..?

Copy link
Collaborator Author

@SEOKKAMONI SEOKKAMONI Oct 20, 2024

Choose a reason for hiding this comment

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

While I agree that we are using eslint-disable-next-line excessively, I’m not sure if changing the rule to 'warn' is the best solution, as it could impact other files across the project.

For example, the most frequently disabled rule is @typescript-eslint/no-deprecated. This rule is mainly applied to deprecated components like Suspensive and DevMode, which are not accessible to users. These are very specific cases, and I’m concerned that if we lower the rule to 'warn', it could unintentionally affect other areas of the codebase where important rules like @typescript-eslint/no-deprecated should remain strictly enforced.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the "best" solution is to actually replace the deprecated syntax with new syntax:

Captura de pantalla 2024-10-20 a las 1 14 15 p  m

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file is intended to test components like Suspensive and SuspensiveProvider. Simply replacing them with DefaultPropsProvider, which doesn’t align with the original purpose, doesn’t seem like a good solution.

I believe that these deprecated files will likely be removed when Suspensive is upgraded to V3. Until then, if there isn’t a better alternative, how about temporarily suppressing the errors with eslint-disable-next-line?

Copy link
Member

@manudeli manudeli Oct 20, 2024

Choose a reason for hiding this comment

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

This thread is getting long, so to speed up the merge of this PR, I would appreciate it if you could first proceed in the way @SEOKKAMONI did, and then raise this issue later. I will create this as a separate issue. #1326

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Let's continue the discussion further in issue #1331! I’d like to express my gratitude to @saul-atomrigs for leaving a thoughtful comment that helps us dive deeper into this topic!

Copy link
Contributor

Choose a reason for hiding this comment

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

@SEOKKAMONI thank you and great effort in this PR..!

SEOKKAMONI and others added 2 commits October 20, 2024 12:08
Co-authored-by: Sol Lee <[email protected]>
Co-authored-by: Varad Gupta <[email protected]>
Co-authored-by: Jonghyeon Ko <[email protected]>
Copy link
Member

@manudeli manudeli left a comment

Choose a reason for hiding this comment

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

❤️❤️❤️ Thanks!! ❤️❤️❤️

@@ -94,7 +94,7 @@ export const suspensiveTypeScriptConfig: ReturnType<typeof tseslint.config> = ts
rules: vitest.configs.recommended.rules,
settings: { vitest: { typecheck: true } },
},
jestDom.configs['flat/recommended'] as unknown as ReturnType<typeof tseslint.config>[number],
Copy link
Member

Choose a reason for hiding this comment

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

Beautiful..❤️

@@ -113,14 +113,14 @@ export const suspensiveTypeScriptConfig: ReturnType<typeof tseslint.config> = ts
],
},
},
eslintPluginPrettierRecommended as unknown as ReturnType<typeof tseslint.config>[number]
Copy link
Member

Choose a reason for hiding this comment

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

Happy..❤️

)

export const suspensiveReactTypeScriptConfig: ReturnType<typeof tseslint.config> = tseslint.config(
...suspensiveTypeScriptConfig,
{
files: ['**/*.{ts,tsx}'],
...(pluginReact.configs.recommended as unknown as ReturnType<typeof tseslint.config>[number]),
Copy link
Member

Choose a reason for hiding this comment

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

So cool...❤️

const returnOfJotai = useAtom(countAtom)
expectTypeOf(result).toEqualTypeOf<typeof returnOfJotai>()
return <></>
}}
</Atom>
)
;() => (
))()
Copy link
Member

Choose a reason for hiding this comment

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

Cool

@@ -1,60 +1,60 @@
import { queryOptions } from '@tanstack/react-query'
Copy link
Member

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: typescript-eslint 8
5 participants