Skip to content

Commit a8d123c

Browse files
chore(deps): update eslint packages (#7086)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vladimir Sheremet <sleuths.slews0s@icloud.com>
1 parent c60ee27 commit a8d123c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+581
-564
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"test:browser:playwright": "pnpm -C test/browser run test:playwright"
3737
},
3838
"devDependencies": {
39-
"@antfu/eslint-config": "^3.11.2",
39+
"@antfu/eslint-config": "^3.16.0",
4040
"@antfu/ni": "^23.2.0",
4141
"@playwright/test": "^1.49.1",
4242
"@rollup/plugin-commonjs": "^28.0.2",
@@ -51,7 +51,7 @@
5151
"bumpp": "^9.10.1",
5252
"changelogithub": "^0.13.11",
5353
"esbuild": "^0.24.2",
54-
"eslint": "^9.16.0",
54+
"eslint": "^9.18.0",
5555
"magic-string": "^0.30.17",
5656
"pathe": "^2.0.1",
5757
"rimraf": "^6.0.1",

packages/browser/src/node/commands/screenshot.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export const screenshot: BrowserCommand<[string, ScreenshotOptions]> = async (
1818
const path = options.path
1919
? resolve(dirname(context.testPath), options.path)
2020
: resolveScreenshotPath(
21-
context.testPath,
22-
name,
23-
context.project.config,
24-
)
21+
context.testPath,
22+
name,
23+
context.project.config,
24+
)
2525
const savePath = normalize(path)
2626
await mkdir(dirname(path), { recursive: true })
2727

packages/browser/src/node/plugin.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,12 @@ function resolveCoverageFolder(vitest: Vitest) {
571571
const options = vitest.config
572572
const htmlReporter = options.coverage?.enabled
573573
? toArray(options.coverage.reporter).find((reporter) => {
574-
if (typeof reporter === 'string') {
575-
return reporter === 'html'
576-
}
574+
if (typeof reporter === 'string') {
575+
return reporter === 'html'
576+
}
577577

578-
return reporter[0] === 'html'
579-
})
578+
return reporter[0] === 'html'
579+
})
580580
: undefined
581581

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

592592
const subdir
593593
= Array.isArray(htmlReporter)
594-
&& htmlReporter.length > 1
595-
&& 'subdir' in htmlReporter[1]
594+
&& htmlReporter.length > 1
595+
&& 'subdir' in htmlReporter[1]
596596
? htmlReporter[1].subdir
597597
: undefined
598598

packages/browser/src/node/serverTester.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function resolveTester(
3737
// if decoded test file is "__vitest_all__" or not in the list of known files, run all tests
3838
const tests
3939
= testFile === '__vitest_all__'
40-
|| !testFiles.includes(testFile)
40+
|| !testFiles.includes(testFile)
4141
? '__vitest_browser_runner__.files'
4242
: JSON.stringify([testFile])
4343
const iframeId = JSON.stringify(testFile)

packages/expect/src/jest-asymmetric-matchers.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ export class ArrayContaining<T = unknown> extends AsymmetricMatcher<Array<T>> {
187187
const matcherContext = this.getMatcherContext()
188188
const result
189189
= this.sample.length === 0
190-
|| (Array.isArray(other)
191-
&& this.sample.every(item =>
192-
other.some(another =>
193-
equals(item, another, matcherContext.customTesters),
194-
),
195-
))
190+
|| (Array.isArray(other)
191+
&& this.sample.every(item =>
192+
other.some(another =>
193+
equals(item, another, matcherContext.customTesters),
194+
),
195+
))
196196

197197
return this.inverse ? !result : result
198198
}

packages/expect/src/jest-expect.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
8181
if (!isNot) {
8282
const message
8383
= utils.flag(this, 'message')
84-
|| 'expected promise to throw an error, but it didn\'t'
84+
|| 'expected promise to throw an error, but it didn\'t'
8585
const error = {
8686
showDiff: false,
8787
}
@@ -469,7 +469,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
469469
const { value, exists } = getValue()
470470
const pass
471471
= exists
472-
&& (args.length === 1 || jestEquals(expected, value, customTesters))
472+
&& (args.length === 1 || jestEquals(expected, value, customTesters))
473473

474474
const valueString
475475
= args.length === 1 ? '' : ` with value ${utils.objDisplay(expected)}`
@@ -751,7 +751,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
751751
if (!isNot) {
752752
const message
753753
= utils.flag(this, 'message')
754-
|| 'expected promise to throw an error, but it didn\'t'
754+
|| 'expected promise to throw an error, but it didn\'t'
755755
const error = {
756756
showDiff: false,
757757
}
@@ -774,7 +774,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
774774
if (!isThrow && !isNot) {
775775
const message
776776
= utils.flag(this, 'message')
777-
|| 'expected function to throw an error, but it didn\'t'
777+
|| 'expected function to throw an error, but it didn\'t'
778778
const error = {
779779
showDiff: false,
780780
}

packages/expect/src/jest-utils.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function eq(
218218
// Deep compare each member
219219
result
220220
= hasKey(b, key)
221-
&& eq(a[key], b[key], aStack, bStack, customTesters, hasKey)
221+
&& eq(a[key], b[key], aStack, bStack, customTesters, hasKey)
222222

223223
if (!result) {
224224
return false
@@ -603,11 +603,11 @@ export function subsetEquality(
603603
}
604604
const result
605605
= object != null
606-
&& hasPropertyInObject(object, key)
607-
&& equals(object[key], subset[key], [
608-
...filteredCustomTesters,
609-
subsetEqualityWithContext(seenReferences),
610-
])
606+
&& hasPropertyInObject(object, key)
607+
&& equals(object[key], subset[key], [
608+
...filteredCustomTesters,
609+
subsetEqualityWithContext(seenReferences),
610+
])
611611
// The main goal of using seenReference is to avoid circular node on tree.
612612
// It will only happen within a parent and its child, not a node and nodes next to it (same level)
613613
// We should keep the reference for a parent and its child only
@@ -759,9 +759,9 @@ export function getObjectSubset(
759759
trimmed[key] = seenReferences.has(object[key])
760760
? seenReferences.get(object[key])
761761
: getObjectSubsetWithContext(seenReferences)(
762-
object[key],
763-
subset[key],
764-
)
762+
object[key],
763+
subset[key],
764+
)
765765
}
766766
else {
767767
if (!seenReferences.has(object[key])) {

packages/mocker/src/node/esmWalker.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ export function esmWalker(
246246
const grandparent = stack[1]
247247
const hasBindingShortcut
248248
= isStaticProperty(parent)
249-
&& parent.shorthand
250-
&& (!isNodeInPattern(parent)
251-
|| isInDestructuringAssignment(parent, parentStack))
249+
&& parent.shorthand
250+
&& (!isNodeInPattern(parent)
251+
|| isInDestructuringAssignment(parent, parentStack))
252252

253253
const classDeclaration
254254
= (parent.type === 'PropertyDefinition'

packages/pretty-format/src/index.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -343,22 +343,22 @@ function printPlugin(
343343
printed = isNewPlugin(plugin)
344344
? plugin.serialize(val, config, indentation, depth, refs, printer)
345345
: plugin.print(
346-
val,
347-
valChild => printer(valChild, config, indentation, depth, refs),
348-
(str) => {
349-
const indentationNext = indentation + config.indent
350-
return (
351-
indentationNext
352-
+ str.replaceAll(NEWLINE_REGEXP, `\n${indentationNext}`)
353-
)
354-
},
355-
{
356-
edgeSpacing: config.spacingOuter,
357-
min: config.min,
358-
spacing: config.spacingInner,
359-
},
360-
config.colors,
361-
)
346+
val,
347+
valChild => printer(valChild, config, indentation, depth, refs),
348+
(str) => {
349+
const indentationNext = indentation + config.indent
350+
return (
351+
indentationNext
352+
+ str.replaceAll(NEWLINE_REGEXP, `\n${indentationNext}`)
353+
)
354+
},
355+
{
356+
edgeSpacing: config.spacingOuter,
357+
min: config.min,
358+
spacing: config.spacingInner,
359+
},
360+
config.colors,
361+
)
362362
}
363363
catch (error: any) {
364364
throw new PrettyFormatPluginError(error.message, error.stack)

packages/pretty-format/src/plugins/DOMElement.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function testNode(val: any) {
3636
const { nodeType, tagName } = val
3737
const isCustomElement
3838
= (typeof tagName === 'string' && tagName.includes('-'))
39-
|| testHasAttribute(val)
39+
|| testHasAttribute(val)
4040

4141
return (
4242
(nodeType === ELEMENT_NODE

packages/pretty-format/src/plugins/Immutable.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ function printImmutableSeq(val: any, config: Config, indentation: string, depth:
8888
// from Immutable collection of entries or from ECMAScript object
8989
val._iter || val._object
9090
? printIteratorEntries(
91-
val.entries(),
92-
config,
93-
indentation,
94-
depth,
95-
refs,
96-
printer,
97-
)
91+
val.entries(),
92+
config,
93+
indentation,
94+
depth,
95+
refs,
96+
printer,
97+
)
9898
: LAZY
9999
}}`
100100
}
@@ -105,13 +105,13 @@ function printImmutableSeq(val: any, config: Config, indentation: string, depth:
105105
|| val._collection // from ECMAScript collection in immutable v4
106106
|| val._iterable // from ECMAScript collection in immutable v3
107107
? printIteratorValues(
108-
val.values(),
109-
config,
110-
indentation,
111-
depth,
112-
refs,
113-
printer,
114-
)
108+
val.values(),
109+
config,
110+
indentation,
111+
depth,
112+
refs,
113+
printer,
114+
)
115115
: LAZY
116116
}]`
117117
}

packages/pretty-format/src/plugins/ReactElement.ts

+20-20
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,27 @@ export const serialize: NewPlugin['serialize'] = (
115115
++depth > config.maxDepth
116116
? printElementAsLeaf(getType(element), config)
117117
: printElement(
118-
getType(element),
119-
printProps(
120-
getPropKeys(element),
121-
element.props,
118+
getType(element),
119+
printProps(
120+
getPropKeys(element),
121+
element.props,
122+
config,
123+
indentation + config.indent,
124+
depth,
125+
refs,
126+
printer,
127+
),
128+
printChildren(
129+
getChildren(element.props.children),
130+
config,
131+
indentation + config.indent,
132+
depth,
133+
refs,
134+
printer,
135+
),
122136
config,
123-
indentation + config.indent,
124-
depth,
125-
refs,
126-
printer,
127-
),
128-
printChildren(
129-
getChildren(element.props.children),
130-
config,
131-
indentation + config.indent,
132-
depth,
133-
refs,
134-
printer,
135-
),
136-
config,
137-
indentation,
138-
)
137+
indentation,
138+
)
139139

140140
export const test: NewPlugin['test'] = (val: unknown) =>
141141
val != null && ReactIs.isElement(val)

packages/pretty-format/src/plugins/ReactTestComponent.ts

+27-27
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function getPropKeys(object: ReactTestObject) {
3333

3434
return props
3535
? Object.keys(props)
36-
.filter(key => props[key] !== undefined)
37-
.sort()
36+
.filter(key => props[key] !== undefined)
37+
.sort()
3838
: []
3939
}
4040

@@ -49,31 +49,31 @@ export const serialize: NewPlugin['serialize'] = (
4949
++depth > config.maxDepth
5050
? printElementAsLeaf(object.type, config)
5151
: printElement(
52-
object.type,
53-
object.props
54-
? printProps(
55-
getPropKeys(object),
56-
object.props,
57-
config,
58-
indentation + config.indent,
59-
depth,
60-
refs,
61-
printer,
62-
)
63-
: '',
64-
object.children
65-
? printChildren(
66-
object.children,
67-
config,
68-
indentation + config.indent,
69-
depth,
70-
refs,
71-
printer,
72-
)
73-
: '',
74-
config,
75-
indentation,
76-
)
52+
object.type,
53+
object.props
54+
? printProps(
55+
getPropKeys(object),
56+
object.props,
57+
config,
58+
indentation + config.indent,
59+
depth,
60+
refs,
61+
printer,
62+
)
63+
: '',
64+
object.children
65+
? printChildren(
66+
object.children,
67+
config,
68+
indentation + config.indent,
69+
depth,
70+
refs,
71+
printer,
72+
)
73+
: '',
74+
config,
75+
indentation,
76+
)
7777

7878
export const test: NewPlugin['test'] = val =>
7979
val && val.$$typeof === testSymbol

packages/pretty-format/src/plugins/lib/markup.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export function printProps(
2929
if (printed.includes('\n')) {
3030
printed
3131
= config.spacingOuter
32-
+ indentationNext
33-
+ printed
34-
+ config.spacingOuter
35-
+ indentation
32+
+ indentationNext
33+
+ printed
34+
+ config.spacingOuter
35+
+ indentation
3636
}
3737
printed = `{${printed}}`
3838
}

0 commit comments

Comments
 (0)