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

ci(eslint): add @cspell/eslint-plugin to prevent misspelling (error) #6718

Merged
merged 16 commits into from
Jan 28, 2024

Conversation

manudeli
Copy link
Contributor

@manudeli manudeli commented Jan 16, 2024

@TkDodo
To resolve #6687 (comment)

This rule will make contributors use correct spelling and I left comment what misspelled words this rule catch

Copy link

vercel bot commented Jan 16, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2024 4:20pm

@manudeli manudeli changed the title ci: add @cspell/eslint-plugin to prevent misspelling (error) ci(eslint): add @cspell/eslint-plugin to prevent misspelling (error) Jan 16, 2024
Copy link

nx-cloud bot commented Jan 16, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 36aa021. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Copy link

codesandbox-ci bot commented Jan 16, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 36aa021:

Sandbox Source
@tanstack/query-example-angular-basic Configuration
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

Copy link
Contributor Author

@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.

These comment was caught by cspell eslint. This rule will remove opportunity to use these misspelling

@@ -7,7 +7,7 @@ const ruleTester = new ESLintUtils.RuleTester({
settings: {},
})

ruleTester.run('no-rest-desctructuring', rule, {
ruleTester.run('no-rest-destructuring', rule, {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

desctructuring -> destructuring

@@ -15,7 +15,7 @@ async function fetchData<TData>(value: TData, ms?: number): Promise<TData> {
}

describe('dehydration and rehydration', () => {
test('should work with serializeable values', async () => {
test('should work with serializable values', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

serializeable -> serializable

@@ -433,7 +433,7 @@ describe('queryClient', () => {
).resolves.toEqual('bar')
})

test('should return the cached query data if the query is found and cached query data is falsey', async () => {
test('should return the cached query data if the query is found and cached query data is falsy', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

falsey -> falsy

@@ -245,7 +245,7 @@ describe('createPersister', () => {
expect(query.fetch).toHaveBeenCalledTimes(1)
})

test('should store item after successfull fetch', async () => {
test('should store item after successful fetch', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

successfull -> successful

@@ -142,7 +142,7 @@ export function persistQueryClientSubscribe(
}
})

const unusbscribeMutationCache = props.queryClient
const unsubscribeMutationCache = props.queryClient
Copy link
Contributor Author

Choose a reason for hiding this comment

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

unusbscribeMutationCache -> unsubscribeMutationCache

@@ -2722,7 +2722,7 @@ describe('useQuery', () => {
await waitFor(() => rendered.getByText('data: 1, isFetching: false'))
})

it('should calculate focus behaviour for `refetchOnWindowFocus` depending on function', async () => {
it('should calculate focus behavior for `refetchOnWindowFocus` depending on function', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

behaviour -> behavior

@@ -46,14 +46,14 @@ function reconcileFn<TData, TError>(
return { ...result, data: newData } as typeof result
}

type HydrateableQueryState<TData, TError> = QueryObserverResult<TData, TError> &
type HydratableQueryState<TData, TError> = QueryObserverResult<TData, TError> &
Copy link
Contributor Author

Choose a reason for hiding this comment

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

HydrateableQueryState -> HydratableQueryState

@@ -170,7 +170,7 @@ export function createBaseQuery<
reconcileOptions === undefined ? false : reconcileOptions,
)
})
// If the query has data we dont suspend but instead mutate the resource
// If the query has data we don't suspend but instead mutate the resource
Copy link
Contributor Author

Choose a reason for hiding this comment

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

dont -> don't

@@ -325,24 +325,24 @@ describe('useQuery', () => {
getCurrentInstanceSpy.mockImplementation(() => ({ suspense: {} }))

let afterTimeout = false
const isEnabeld = ref(false)
const isEnabled = ref(false)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

isEnabeld -> isEnabled

@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2024

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (8fff654) 41.78% compared to head (36aa021) 41.78%.

Files Patch % Lines
packages/query-devtools/src/Devtools.tsx 0.00% 9 Missing ⚠️
packages/solid-query/src/createBaseQuery.ts 57.14% 3 Missing ⚠️
...verloads/__testfixtures__/default-import.input.tsx 0.00% 2 Missing ⚠️
...erloads/__testfixtures__/default-import.output.tsx 0.00% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6718   +/-   ##
=======================================
  Coverage   41.78%   41.78%           
=======================================
  Files         178      178           
  Lines        7017     7017           
  Branches     1421     1421           
=======================================
  Hits         2932     2932           
  Misses       3722     3722           
  Partials      363      363           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

'error',
{
cspell: {
words: [
Copy link
Collaborator

Choose a reason for hiding this comment

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

instead of keeping this list that long, could we not just replace some of these that are only used in tests or local variables with known words?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try it soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made it simpler than before in c8770ba

@manudeli manudeli force-pushed the ci/eslint/cspell-as-error branch from c2917ce to c8770ba Compare January 20, 2024 04:32
@@ -705,7 +707,7 @@ describe("useQuery's in Suspense mode", () => {
expect(queryFn).toHaveBeenCalledTimes(1)
})

it('should error catched in error boundary without infinite loop', async () => {
it('should error caught in error boundary without infinite loop', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

catched -> caught

@@ -263,8 +263,8 @@ export function createBaseQuery<
on(
[isRestoring, observer],
([restoring]) => {
const unsub = unsubscribe
queueMicrotask(() => unsub?.())
const _unsubscribe = unsubscribe
Copy link
Contributor Author

Choose a reason for hiding this comment

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

same internal variable name as _*

@@ -2859,7 +2859,7 @@ describe('useQuery', () => {
const { status, error } = useQuery({
queryKey: key,
queryFn: () => {
return Promise.reject(new Error('Error test jaylen'))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know jaylen, but I thought it as unnecessary string

@@ -196,7 +196,7 @@ describe('queryClient', () => {
expect(() => {
queryClient.setQueryData([key, user], (prevUser?: typeof user) => ({
...prevUser!,
name: 'Edvin',
name: 'James',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought James is general user name than Edvin

@@ -364,13 +364,13 @@ ruleTester.run('exhaustive-deps', rule, {
const CONST_VAL = 1
function useHook() {
const queryClient = useQueryClient()
const kueryKlient = useQueryClient()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

kuery -> query

@manudeli manudeli requested a review from TkDodo January 20, 2024 04:44
@manudeli
Copy link
Contributor Author

@TkDodo check this again please

@TkDodo TkDodo merged commit b32ad24 into TanStack:main Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants