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

chore(deps): update eslint packages #6958

Merged
merged 2 commits into from
Dec 4, 2024
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"test:browser:playwright": "pnpm -C test/browser run test:playwright"
},
"devDependencies": {
"@antfu/eslint-config": "^3.8.0",
"@antfu/eslint-config": "^3.11.2",
"@antfu/ni": "^0.23.1",
"@playwright/test": "^1.49.0",
"@rollup/plugin-commonjs": "^28.0.1",
Expand All @@ -51,7 +51,7 @@
"bumpp": "^9.8.1",
"changelogithub": "^0.13.11",
"esbuild": "^0.24.0",
"eslint": "^9.14.0",
"eslint": "^9.16.0",
"magic-string": "^0.30.14",
"pathe": "^1.1.2",
"rimraf": "^6.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/coverage-istanbul/src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { CoverageProvider, ReportContext, ResolvedCoverageOptions, Vitest } from 'vitest/node'
import { promises as fs } from 'node:fs'
// @ts-expect-error missing types
import { defaults as istanbulDefaults } from '@istanbuljs/schema'
import createDebug from 'debug'
import libCoverage, { type CoverageMap } from 'istanbul-lib-coverage'
import { createInstrumenter, type Instrumenter } from 'istanbul-lib-instrument'
Expand All @@ -11,8 +13,6 @@ import { resolve } from 'pathe'
import TestExclude from 'test-exclude'
import c from 'tinyrainbow'
import { BaseCoverageProvider } from 'vitest/coverage'
// @ts-expect-error missing types
import { defaults as istanbulDefaults } from '@istanbuljs/schema'

import { version } from '../package.json' with { type: 'json' }
import { COVERAGE_STORE_KEY } from './constants'
Expand Down
6 changes: 3 additions & 3 deletions packages/mocker/src/node/esmWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function esmWalker(
if (
(parent?.type === 'TemplateLiteral'
&& parent?.expressions.includes(child))
|| (parent?.type === 'CallExpression' && parent?.callee === child)
|| (parent?.type === 'CallExpression' && parent?.callee === child)
) {
return
}
Expand Down Expand Up @@ -253,7 +253,7 @@ export function esmWalker(
const classDeclaration
= (parent.type === 'PropertyDefinition'
&& grandparent?.type === 'ClassBody')
|| (parent.type === 'ClassDeclaration' && node === parent.superClass)
|| (parent.type === 'ClassDeclaration' && node === parent.superClass)

const classExpression
= parent.type === 'ClassExpression' && node === parent.id
Expand All @@ -277,7 +277,7 @@ function isRefIdentifier(id: Identifier, parent: _Node, parentStack: _Node[]) {
parent.type === 'CatchClause'
|| ((parent.type === 'VariableDeclarator'
|| parent.type === 'ClassDeclaration')
&& parent.id === id)
&& parent.id === id)
) {
return false
}
Expand Down
6 changes: 3 additions & 3 deletions packages/pretty-format/src/plugins/DOMElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ function testNode(val: any) {
return (
(nodeType === ELEMENT_NODE
&& (ELEMENT_REGEXP.test(constructorName) || isCustomElement))
|| (nodeType === TEXT_NODE && constructorName === 'Text')
|| (nodeType === COMMENT_NODE && constructorName === 'Comment')
|| (nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment')
|| (nodeType === TEXT_NODE && constructorName === 'Text')
|| (nodeType === COMMENT_NODE && constructorName === 'Comment')
|| (nodeType === FRAGMENT_NODE && constructorName === 'DocumentFragment')
)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/components/BrowserIframe.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { viewport } from '~/composables/browser'
import type { ViewportSize } from '~/composables/browser'
import { viewport } from '~/composables/browser'
import {
hideRightPanel,
panels,
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/client/components/FileDetails.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { ModuleGraph } from '~/composables/module-graph'
import type { Params } from '~/composables/params'
import { hasFailedSnapshot } from '@vitest/ws-client'
import {
browserState,
Expand All @@ -7,9 +9,7 @@ import {
currentLogs,
isReport,
} from '~/composables/client'
import type { ModuleGraph } from '~/composables/module-graph'
import { getModuleGraph } from '~/composables/module-graph'
import type { Params } from '~/composables/params'
import { viewMode } from '~/composables/params'
import { getProjectNameColor } from '~/utils/task'

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/components/explorer/ExplorerItem.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script setup lang="ts">
import type { Task, TaskState } from '@vitest/runner'
import type { TaskTreeNodeType } from '~/composables/explorer/types'
import { hasFailedSnapshot } from '@vitest/ws-client'
import { Tooltip as VueTooltip } from 'floating-vue'
import { nextTick } from 'vue'
import { client, isReport, runFiles, runTask } from '~/composables/client'
import { showSource } from '~/composables/codemirror'
import { explorerTree } from '~/composables/explorer'
import { escapeHtml, highlightRegex } from '~/composables/explorer/state'
import type { TaskTreeNodeType } from '~/composables/explorer/types'
import { coverageEnabled } from '~/composables/navigation'

// TODO: better handling of "opened" - it means to forcefully open the tree item and set in TasksList right now
Expand Down
14 changes: 7 additions & 7 deletions packages/ui/client/components/views/ViewModuleGraph.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<script setup lang="ts">
import type { ResizeContext } from 'd3-graph-controller'
import type { Selection } from 'd3-selection'
import {
defineGraphConfig,
GraphController,
Markers,
PositionInitializers,
} from 'd3-graph-controller'
import { isReport } from '~/composables/client'
import type {
ModuleGraph,
ModuleGraphController,
ModuleLink,
ModuleNode,
ModuleType,
} from '~/composables/module-graph'
import {
defineGraphConfig,
GraphController,
Markers,
PositionInitializers,
} from 'd3-graph-controller'
import { isReport } from '~/composables/client'

const props = defineProps<{
graph: ModuleGraph
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/composables/explorer/collapse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { UITaskTreeNode } from '~/composables/explorer/types'
import { explorerTree } from '~/composables/explorer/index'
import { openedTreeItems, treeFilter, uiEntries } from '~/composables/explorer/state'
import type { UITaskTreeNode } from '~/composables/explorer/types'
import { isFileNode, isParentNode } from '~/composables/explorer/utils'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/composables/explorer/collector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Custom, File, Task, TaskResultPack, Test } from '@vitest/runner'
import type { Arrayable } from '@vitest/utils'
import type { CollectFilteredTests, CollectorInfo, Filter, FilteredTests } from '~/composables/explorer/types'
import { isAtomTest } from '@vitest/runner/utils'
import { toArray } from '@vitest/utils'
import { hasFailedSnapshot } from '@vitest/ws-client'
Expand All @@ -14,7 +15,6 @@ import {
uiEntries,
uiFiles,
} from '~/composables/explorer/state'
import type { CollectFilteredTests, CollectorInfo, Filter, FilteredTests } from '~/composables/explorer/types'
import {
createOrUpdateFileNode,
createOrUpdateNodeTask,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/composables/explorer/expand.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Filter, UITaskTreeNode } from '~/composables/explorer/types'
import { findById } from '~/composables/client'
import { filterAll, filterNode } from '~/composables/explorer/filter'
import { explorerTree } from '~/composables/explorer/index'
import { filteredFiles, openedTreeItems, treeFilter, uiEntries } from '~/composables/explorer/state'
import type { Filter, UITaskTreeNode } from '~/composables/explorer/types'
import { createOrUpdateNode, createOrUpdateSuiteTask, isFileNode, isParentNode } from '~/composables/explorer/utils'

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/composables/explorer/filter.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Task } from '@vitest/runner'
import type { FileTreeNode, Filter, FilterResult, ParentTreeNode, UITaskTreeNode } from '~/composables/explorer/types'
import { client, findById } from '~/composables/client'
import { explorerTree } from '~/composables/explorer/index'
import { filteredFiles, uiEntries } from '~/composables/explorer/state'
import type { FileTreeNode, Filter, FilterResult, ParentTreeNode, UITaskTreeNode } from '~/composables/explorer/types'
import {
isFileNode,
isParentNode,
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/client/composables/explorer/tree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import type { File, TaskResultPack } from '@vitest/runner'
import type {
CollectorInfo,
FilteredTests,
RootTreeNode,
UITaskTreeNode,
} from '~/composables/explorer/types'
import { runCollapseAllTask, runCollapseNode } from '~/composables/explorer/collapse'
import { collectTestsTotalData, preparePendingTasks, runCollect, runLoadFiles } from '~/composables/explorer/collector'
import { runExpandAll, runExpandNode } from '~/composables/explorer/expand'
Expand All @@ -7,12 +13,6 @@ import {
filter,
search,
} from '~/composables/explorer/state'
import type {
CollectorInfo,
FilteredTests,
RootTreeNode,
UITaskTreeNode,
} from '~/composables/explorer/types'

export class ExplorerTree {
private rafCollector: ReturnType<typeof useRafFn>
Expand Down
8 changes: 4 additions & 4 deletions packages/ui/client/composables/explorer/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import type { File, Task } from '@vitest/runner'
import { isAtomTest } from '@vitest/runner/utils'
import { client } from '~/composables/client'
import { explorerTree } from '~/composables/explorer/index'
import { openedTreeItemsSet } from '~/composables/explorer/state'
import type {
CustomTestTreeNode,
FileTreeNode,
Expand All @@ -11,6 +7,10 @@ import type {
TestTreeNode,
UITaskTreeNode,
} from '~/composables/explorer/types'
import { isAtomTest } from '@vitest/runner/utils'
import { client } from '~/composables/client'
import { explorerTree } from '~/composables/explorer/index'
import { openedTreeItemsSet } from '~/composables/explorer/state'
import { getProjectNameColor, isSuite as isTaskSuite } from '~/utils/task'

export function isTestNode(node: UITaskTreeNode): node is TestTreeNode | CustomTestTreeNode {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/diff/cleanupSemantic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ function diff_cleanupSemanticScore_(one: string, two: string): number {
}

export {
Diff,
diff_cleanupSemantic as cleanupSemantic,
Diff,
DIFF_DELETE,
DIFF_EQUAL,
DIFF_INSERT,
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/src/diff/diffLines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export function printDiffLines(
+ (options.expand
? joinAlignedDiffsExpand(diffs, options)
: joinAlignedDiffsNoExpand(diffs, options))
+ (truncated
? options.truncateAnnotationColor(`\n${options.truncateAnnotation}`)
: '')
+ (truncated
? options.truncateAnnotationColor(`\n${options.truncateAnnotation}`)
: '')
)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/plugins/cssEnabler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function CSSEnablerPlugin(ctx: {
const scopeStrategy
= (typeof ctx.config.css !== 'boolean'
&& ctx.config.css.modules?.classNameStrategy)
|| 'stable'
|| 'stable'
const proxyReturn = getCSSModuleProxyReturn(
scopeStrategy,
relative(ctx.config.root, id),
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export async function VitestPlugin(
const classNameStrategy
= (typeof testConfig.css !== 'boolean'
&& testConfig.css?.modules?.classNameStrategy)
|| 'stable'
|| 'stable'

if (classNameStrategy !== 'scoped') {
config.css ??= {}
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/plugins/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export function WorkspaceVitestPlugin(
const classNameStrategy
= (typeof testConfig.css !== 'boolean'
&& testConfig.css?.modules?.classNameStrategy)
|| 'stable'
|| 'stable'

if (classNameStrategy !== 'scoped') {
config.css ??= {}
Expand Down
14 changes: 7 additions & 7 deletions packages/vitest/src/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,27 +277,27 @@ export {
test,
} from '@vitest/runner'
export type {
Custom as RunnerCustomCase,
ExtendedContext,
File as RunnerTestFile,
HookCleanupCallback,
HookListener,
OnTestFailedHandler,
OnTestFinishedHandler,
RunMode,
Custom as RunnerCustomCase,
Task as RunnerTask,
TaskBase as RunnerTaskBase,
TaskResult as RunnerTaskResult,
TaskResultPack as RunnerTaskResultPack,
Test as RunnerTestCase,
File as RunnerTestFile,
Suite as RunnerTestSuite,
SuiteAPI,
SuiteCollector,
SuiteFactory,
Task as RunnerTask,
TaskBase as RunnerTaskBase,
TaskContext,
TaskCustomOptions,
TaskMeta,
TaskResult as RunnerTaskResult,
TaskResultPack as RunnerTaskResultPack,
TaskState,
Test as RunnerTestCase,
TestAPI,
TestContext,
TestFunction,
Expand Down
4 changes: 2 additions & 2 deletions packages/vitest/src/public/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export { startVitest } from '../node/cli/cli-api'
export { resolveApiServerConfig, resolveConfig } from '../node/config/resolveConfig'
export type { Vitest } from '../node/core'
export { createVitest } from '../node/create'
export { FilesNotFoundError as TestsNotFoundError, GitNotFoundError } from '../node/errors'
export { GitNotFoundError, FilesNotFoundError as TestsNotFoundError } from '../node/errors'
export type { GlobalSetupContext } from '../node/globalSetup'
export { VitestPackageInstaller } from '../node/packageInstaller'
export { VitestPlugin } from '../node/plugins'
Expand Down Expand Up @@ -122,9 +122,9 @@ export type {
CollectLineNumbers as TypeCheckCollectLineNumbers,
CollectLines as TypeCheckCollectLines,
Context as TypeCheckContext,
TscErrorInfo as TypeCheckErrorInfo,
RawErrsMap as TypeCheckRawErrorsMap,
RootAndTarget as TypeCheckRootAndTarget,
TscErrorInfo as TypeCheckErrorInfo,
} from '../typecheck/types'

export type {
Expand Down
6 changes: 3 additions & 3 deletions packages/ws-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { BirpcOptions, BirpcReturn } from 'birpc'
import { createBirpc } from 'birpc'
import { parse, stringify } from 'flatted'

// eslint-disable-next-line no-restricted-imports
import type { WebSocketEvents, WebSocketHandlers } from 'vitest'
import { createBirpc } from 'birpc'

import { parse, stringify } from 'flatted'
import { StateManager } from './state'

export * from '../../vitest/src/utils/tasks'
Expand Down
Loading
Loading