Skip to content

fix: Fix ESLint warnings #5510

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

Merged
merged 2 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const config = {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-inferrable-types': [
'error',
{ ignoreParameters: true },
Expand Down
2 changes: 1 addition & 1 deletion packages/query-devtools/src/Explorer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { displayValue } from './utils'
import superjson from 'superjson'
import * as superjson from 'superjson'
import { css, cx } from '@emotion/css'
import { tokens } from './theme'
import { createMemo, createSignal, Index, Match, Show, Switch } from 'solid-js'
Expand Down
4 changes: 2 additions & 2 deletions packages/query-devtools/src/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Query } from '@tanstack/query-core'
import SuperJSON from 'superjson'
import * as superjson from 'superjson'

export function getQueryStatusLabel(query: Query) {
return query.state.fetchStatus === 'fetching'
Expand Down Expand Up @@ -60,7 +60,7 @@ export function getQueryStatusColorByLabel(label: IQueryStatusLabel) {
* @param {boolean} beautify Formats json to multiline
*/
export const displayValue = (value: unknown, beautify: boolean = false) => {
const { json } = SuperJSON.serialize(value)
const { json } = superjson.serialize(value)

return JSON.stringify(json, null, beautify ? 2 : undefined)
}
Expand Down
4 changes: 2 additions & 2 deletions packages/react-query/src/__tests__/ssr-hydration.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'
import ReactDOM from 'react-dom'
import ReactDOMTestUtils from 'react-dom/test-utils'
import ReactDOMServer from 'react-dom/server'
import * as ReactDOMTestUtils from 'react-dom/test-utils'
import * as ReactDOMServer from 'react-dom/server'
// eslint-disable-next-line import/no-unresolved -- types only for module augmentation
import type {} from 'react-dom/next'
import { vi } from 'vitest'
Expand Down
17 changes: 7 additions & 10 deletions scripts/publish.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,14 @@ async function run() {
/** Uses packages and changedFiles to determine which packages have changed */
const changedPackages = RELEASE_ALL
? packages
: changedFiles.reduce((acc, file) => {
const pkg = packages.find(
(p) =>
file.startsWith(path.join(p.packageDir, 'src')) ||
file.startsWith(path.join(p.packageDir, 'package.json')),
: packages.filter((pkg) => {
const changed = changedFiles.some(
(file) =>
file.startsWith(path.join(pkg.packageDir, 'src')) ||
file.startsWith(path.join(pkg.packageDir, 'package.json')),
)
if (pkg && !acc.find((d) => d.name === pkg.name)) {
acc.push(pkg)
}
return acc
}, /** @type {import('./types').Package[]} */ ([]))
return changed
})

// If a package has a dependency that has been updated, we need to update the
// package that depends on it as well.
Expand Down