Skip to content

Commit

Permalink
chore(deps): update eslint packages (#7086)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vladimir Sheremet <[email protected]>
  • Loading branch information
renovate[bot] and sheremet-va authored Jan 22, 2025
1 parent c60ee27 commit a8d123c
Show file tree
Hide file tree
Showing 47 changed files with 581 additions and 564 deletions.
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.11.2",
"@antfu/eslint-config": "^3.16.0",
"@antfu/ni": "^23.2.0",
"@playwright/test": "^1.49.1",
"@rollup/plugin-commonjs": "^28.0.2",
Expand All @@ -51,7 +51,7 @@
"bumpp": "^9.10.1",
"changelogithub": "^0.13.11",
"esbuild": "^0.24.2",
"eslint": "^9.16.0",
"eslint": "^9.18.0",
"magic-string": "^0.30.17",
"pathe": "^2.0.1",
"rimraf": "^6.0.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/browser/src/node/commands/screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ export const screenshot: BrowserCommand<[string, ScreenshotOptions]> = async (
const path = options.path
? resolve(dirname(context.testPath), options.path)
: resolveScreenshotPath(
context.testPath,
name,
context.project.config,
)
context.testPath,
name,
context.project.config,
)
const savePath = normalize(path)
await mkdir(dirname(path), { recursive: true })

Expand Down
14 changes: 7 additions & 7 deletions packages/browser/src/node/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,12 @@ function resolveCoverageFolder(vitest: Vitest) {
const options = vitest.config
const htmlReporter = options.coverage?.enabled
? toArray(options.coverage.reporter).find((reporter) => {
if (typeof reporter === 'string') {
return reporter === 'html'
}
if (typeof reporter === 'string') {
return reporter === 'html'
}

return reporter[0] === 'html'
})
return reporter[0] === 'html'
})
: undefined

if (!htmlReporter) {
Expand All @@ -591,8 +591,8 @@ function resolveCoverageFolder(vitest: Vitest) {

const subdir
= Array.isArray(htmlReporter)
&& htmlReporter.length > 1
&& 'subdir' in htmlReporter[1]
&& htmlReporter.length > 1
&& 'subdir' in htmlReporter[1]
? htmlReporter[1].subdir
: undefined

Expand Down
2 changes: 1 addition & 1 deletion packages/browser/src/node/serverTester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function resolveTester(
// if decoded test file is "__vitest_all__" or not in the list of known files, run all tests
const tests
= testFile === '__vitest_all__'
|| !testFiles.includes(testFile)
|| !testFiles.includes(testFile)
? '__vitest_browser_runner__.files'
: JSON.stringify([testFile])
const iframeId = JSON.stringify(testFile)
Expand Down
12 changes: 6 additions & 6 deletions packages/expect/src/jest-asymmetric-matchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ export class ArrayContaining<T = unknown> extends AsymmetricMatcher<Array<T>> {
const matcherContext = this.getMatcherContext()
const result
= this.sample.length === 0
|| (Array.isArray(other)
&& this.sample.every(item =>
other.some(another =>
equals(item, another, matcherContext.customTesters),
),
))
|| (Array.isArray(other)
&& this.sample.every(item =>
other.some(another =>
equals(item, another, matcherContext.customTesters),
),
))

return this.inverse ? !result : result
}
Expand Down
8 changes: 4 additions & 4 deletions packages/expect/src/jest-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
if (!isNot) {
const message
= utils.flag(this, 'message')
|| 'expected promise to throw an error, but it didn\'t'
|| 'expected promise to throw an error, but it didn\'t'
const error = {
showDiff: false,
}
Expand Down Expand Up @@ -469,7 +469,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
const { value, exists } = getValue()
const pass
= exists
&& (args.length === 1 || jestEquals(expected, value, customTesters))
&& (args.length === 1 || jestEquals(expected, value, customTesters))

const valueString
= args.length === 1 ? '' : ` with value ${utils.objDisplay(expected)}`
Expand Down Expand Up @@ -751,7 +751,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
if (!isNot) {
const message
= utils.flag(this, 'message')
|| 'expected promise to throw an error, but it didn\'t'
|| 'expected promise to throw an error, but it didn\'t'
const error = {
showDiff: false,
}
Expand All @@ -774,7 +774,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
if (!isThrow && !isNot) {
const message
= utils.flag(this, 'message')
|| 'expected function to throw an error, but it didn\'t'
|| 'expected function to throw an error, but it didn\'t'
const error = {
showDiff: false,
}
Expand Down
18 changes: 9 additions & 9 deletions packages/expect/src/jest-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function eq(
// Deep compare each member
result
= hasKey(b, key)
&& eq(a[key], b[key], aStack, bStack, customTesters, hasKey)
&& eq(a[key], b[key], aStack, bStack, customTesters, hasKey)

if (!result) {
return false
Expand Down Expand Up @@ -603,11 +603,11 @@ export function subsetEquality(
}
const result
= object != null
&& hasPropertyInObject(object, key)
&& equals(object[key], subset[key], [
...filteredCustomTesters,
subsetEqualityWithContext(seenReferences),
])
&& hasPropertyInObject(object, key)
&& equals(object[key], subset[key], [
...filteredCustomTesters,
subsetEqualityWithContext(seenReferences),
])
// The main goal of using seenReference is to avoid circular node on tree.
// It will only happen within a parent and its child, not a node and nodes next to it (same level)
// We should keep the reference for a parent and its child only
Expand Down Expand Up @@ -759,9 +759,9 @@ export function getObjectSubset(
trimmed[key] = seenReferences.has(object[key])
? seenReferences.get(object[key])
: getObjectSubsetWithContext(seenReferences)(
object[key],
subset[key],
)
object[key],
subset[key],
)
}
else {
if (!seenReferences.has(object[key])) {
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 @@ -246,9 +246,9 @@ export function esmWalker(
const grandparent = stack[1]
const hasBindingShortcut
= isStaticProperty(parent)
&& parent.shorthand
&& (!isNodeInPattern(parent)
|| isInDestructuringAssignment(parent, parentStack))
&& parent.shorthand
&& (!isNodeInPattern(parent)
|| isInDestructuringAssignment(parent, parentStack))

const classDeclaration
= (parent.type === 'PropertyDefinition'
Expand Down
32 changes: 16 additions & 16 deletions packages/pretty-format/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,22 +343,22 @@ function printPlugin(
printed = isNewPlugin(plugin)
? plugin.serialize(val, config, indentation, depth, refs, printer)
: plugin.print(
val,
valChild => printer(valChild, config, indentation, depth, refs),
(str) => {
const indentationNext = indentation + config.indent
return (
indentationNext
+ str.replaceAll(NEWLINE_REGEXP, `\n${indentationNext}`)
)
},
{
edgeSpacing: config.spacingOuter,
min: config.min,
spacing: config.spacingInner,
},
config.colors,
)
val,
valChild => printer(valChild, config, indentation, depth, refs),
(str) => {
const indentationNext = indentation + config.indent
return (
indentationNext
+ str.replaceAll(NEWLINE_REGEXP, `\n${indentationNext}`)
)
},
{
edgeSpacing: config.spacingOuter,
min: config.min,
spacing: config.spacingInner,
},
config.colors,
)
}
catch (error: any) {
throw new PrettyFormatPluginError(error.message, error.stack)
Expand Down
2 changes: 1 addition & 1 deletion packages/pretty-format/src/plugins/DOMElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function testNode(val: any) {
const { nodeType, tagName } = val
const isCustomElement
= (typeof tagName === 'string' && tagName.includes('-'))
|| testHasAttribute(val)
|| testHasAttribute(val)

return (
(nodeType === ELEMENT_NODE
Expand Down
28 changes: 14 additions & 14 deletions packages/pretty-format/src/plugins/Immutable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ function printImmutableSeq(val: any, config: Config, indentation: string, depth:
// from Immutable collection of entries or from ECMAScript object
val._iter || val._object
? printIteratorEntries(
val.entries(),
config,
indentation,
depth,
refs,
printer,
)
val.entries(),
config,
indentation,
depth,
refs,
printer,
)
: LAZY
}}`
}
Expand All @@ -105,13 +105,13 @@ function printImmutableSeq(val: any, config: Config, indentation: string, depth:
|| val._collection // from ECMAScript collection in immutable v4
|| val._iterable // from ECMAScript collection in immutable v3
? printIteratorValues(
val.values(),
config,
indentation,
depth,
refs,
printer,
)
val.values(),
config,
indentation,
depth,
refs,
printer,
)
: LAZY
}]`
}
Expand Down
40 changes: 20 additions & 20 deletions packages/pretty-format/src/plugins/ReactElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,27 +115,27 @@ export const serialize: NewPlugin['serialize'] = (
++depth > config.maxDepth
? printElementAsLeaf(getType(element), config)
: printElement(
getType(element),
printProps(
getPropKeys(element),
element.props,
getType(element),
printProps(
getPropKeys(element),
element.props,
config,
indentation + config.indent,
depth,
refs,
printer,
),
printChildren(
getChildren(element.props.children),
config,
indentation + config.indent,
depth,
refs,
printer,
),
config,
indentation + config.indent,
depth,
refs,
printer,
),
printChildren(
getChildren(element.props.children),
config,
indentation + config.indent,
depth,
refs,
printer,
),
config,
indentation,
)
indentation,
)

export const test: NewPlugin['test'] = (val: unknown) =>
val != null && ReactIs.isElement(val)
Expand Down
54 changes: 27 additions & 27 deletions packages/pretty-format/src/plugins/ReactTestComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function getPropKeys(object: ReactTestObject) {

return props
? Object.keys(props)
.filter(key => props[key] !== undefined)
.sort()
.filter(key => props[key] !== undefined)
.sort()
: []
}

Expand All @@ -49,31 +49,31 @@ export const serialize: NewPlugin['serialize'] = (
++depth > config.maxDepth
? printElementAsLeaf(object.type, config)
: printElement(
object.type,
object.props
? printProps(
getPropKeys(object),
object.props,
config,
indentation + config.indent,
depth,
refs,
printer,
)
: '',
object.children
? printChildren(
object.children,
config,
indentation + config.indent,
depth,
refs,
printer,
)
: '',
config,
indentation,
)
object.type,
object.props
? printProps(
getPropKeys(object),
object.props,
config,
indentation + config.indent,
depth,
refs,
printer,
)
: '',
object.children
? printChildren(
object.children,
config,
indentation + config.indent,
depth,
refs,
printer,
)
: '',
config,
indentation,
)

export const test: NewPlugin['test'] = val =>
val && val.$$typeof === testSymbol
Expand Down
8 changes: 4 additions & 4 deletions packages/pretty-format/src/plugins/lib/markup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export function printProps(
if (printed.includes('\n')) {
printed
= config.spacingOuter
+ indentationNext
+ printed
+ config.spacingOuter
+ indentation
+ indentationNext
+ printed
+ config.spacingOuter
+ indentation
}
printed = `{${printed}}`
}
Expand Down
Loading

0 comments on commit a8d123c

Please sign in to comment.