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

Update eslint/prettier #759

Merged
merged 2 commits into from
Jul 25, 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
290 changes: 145 additions & 145 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@types/jest": "29.5.12",
"@types/node": "16.18.34",
"@types/polka": "0.5.7",
"@typescript-eslint/eslint-plugin": "6.4.1",
"@typescript-eslint/parser": "6.4.1",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"@vue/compiler-sfc": "3.3.4",
"ansi-regex": "6.0.1",
"aria-query": "5.1.3",
Expand All @@ -44,7 +44,7 @@
"dom-accessibility-api": "0.6.1",
"errorstacks": "2.4.0",
"es-jest": "2.1.0",
"eslint": "8.47.0",
"eslint": "8.57.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"kolorist": "1.8.0",
Expand All @@ -53,7 +53,7 @@
"mime": "4.0.4",
"polka": "0.5.2",
"preact": "10.15.1",
"prettier": "3.0.2",
"prettier": "3.3.3",
"pretty-format": "29.7.0",
"prop-types": "15.8.1",
"react": "18.2.0",
Expand Down
13 changes: 6 additions & 7 deletions src/jest-dom/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ const runUtilInNode = (name: string, args: any[]) => {
return `$JEST_UTILS.${name}$${stringifiedArgs}$END_JEST_UTILS$`;
};

type RecursivePartial<T> = T extends Record<string, unknown>
? T extends () => any
? T
: {
[K in keyof T]?: RecursivePartial<T[K]>;
}
: T;
type RecursivePartial<T> =
T extends Record<string, unknown>
? T extends () => any
? T
: { [K in keyof T]?: RecursivePartial<T[K]> }
: T;

export const jestContext: RecursivePartial<jest.MatcherUtils> = {
equals: (a, b) =>
Expand Down
8 changes: 4 additions & 4 deletions src/module-server/client-runtime-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ const clientRuntimeMiddleware =
req.path === '/@pleasantest/jest-dom'
? 'jest-dom.js'
: req.path === '/@pleasantest/user-util'
? 'user-util.js'
: req.path === '/@pleasantest/accessibility'
? 'accessibility.js'
: 'pptr-testing-library-client.js',
? 'user-util.js'
: req.path === '/@pleasantest/accessibility'
? 'accessibility.js'
: 'pptr-testing-library-client.js',
);
const text = await fs.readFile(filePath, 'utf8');
res.end(text);
Expand Down
4 changes: 2 additions & 2 deletions src/pptr-testing-library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
type ElementToElementHandle<Input> = Input extends Element
? ElementHandle<Input>
: Input extends (Element | ElementHandle)[]
? { [K in keyof Input]: ElementToElementHandle<Input[K]> }
: Input;
? { [K in keyof Input]: ElementToElementHandle<Input[K]> }
: Input;

type Promisify<Input> = Input extends Promise<any> ? Input : Promise<Input>;
type ValueOf<Input> = Input extends any[] ? Input[number] : Input[keyof Input];
Expand Down
8 changes: 4 additions & 4 deletions src/serialize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ export const printElement = (
attr.value.length > 40 && attr.name === 'd' && tagName === 'path'
? `${attr.value.slice(0, 30)}[...]`
: attr.value.length > 150
? `${attr.value.slice(0, 150)}[...]`
: attr.value;
? `${attr.value.slice(0, 150)}[...]`
: attr.value;
return `${highlight.attribute(attr.name)}${highlight.equals(
'=',
)}${highlight.string(`"${truncatedAttrValue}"`)}`;
Expand All @@ -166,8 +166,8 @@ export const printElement = (
selfClosing
? highlight.bracket(`${splitAttrs ? '\n' : ' '}/`)
: splitAttrs
? '\n'
: ''
? '\n'
: ''
}${highlight.bracket('>')}${
selfClosing
? ''
Expand Down
16 changes: 8 additions & 8 deletions tests/testing-library-queries/variants-of-queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ type Equal<A, B> = A extends (infer T1)[]
? Equal<T1, T2>
: false
: A extends ElementHandle<infer T1>
? B extends ElementHandle<infer T2>
? Equal<T1, T2>
: false
: B extends A
? A extends B
? true
: false
: false;
? B extends ElementHandle<infer T2>
? Equal<T1, T2>
: false
: B extends A
? A extends B
? true
: false
: false;

test(
'findBy',
Expand Down
Loading