Skip to content

Commit c6692dd

Browse files
authored
Merge pull request #316 from david-tejada/update-packages
Update dependencies jest-puppeteer, xo and eslint plugins
2 parents af42008 + 5016b0d commit c6692dd

File tree

108 files changed

+5765
-4425
lines changed

Some content is hidden

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

108 files changed

+5765
-4425
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
env:
2121
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
2222
with:
23-
node-version: 18
23+
node-version: 20
2424
- run: npm install
2525
- uses: david-tejada/puppeteer-headful@master
2626
with:

.xo-config.json

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
{
2+
"extends": ["xo-react", "plugin:react/jsx-runtime"],
3+
"parserOptions": {
4+
"project": "./tsconfig.xo.json"
5+
},
6+
"envs": ["browser"],
7+
"prettier": "true",
8+
"globals": {
9+
"page": true,
10+
"browser": true,
11+
"context": true,
12+
"jestPuppeteer": true
13+
},
14+
"rules": {
15+
"@typescript-eslint/switch-exhaustiveness-check": "off",
16+
"no-unused-vars": [
17+
"error",
18+
{
19+
"varsIgnorePattern": "browser"
20+
}
21+
],
22+
"unicorn/prefer-top-level-await": "off",
23+
"n/file-extension-in-import": "off",
24+
"import/extensions": [
25+
2,
26+
"never",
27+
{
28+
"png": "always",
29+
"html": "always"
30+
}
31+
],
32+
"unicorn/filename-case": [
33+
"error",
34+
{
35+
"cases": {
36+
"camelCase": true,
37+
"pascalCase": true
38+
}
39+
}
40+
],
41+
"node/prefer-global/process": "off",
42+
"complexity": "off",
43+
"no-use-extend-native/no-use-extend-native": "off",
44+
"unicorn/no-array-callback-reference": "off",
45+
"unicorn/prefer-node-protocol": "off",
46+
"@typescript-eslint/ban-types": "off",
47+
"no-redeclare": "off",
48+
"@typescript-eslint/no-redeclare": "off",
49+
"unicorn/prevent-abbreviations": [
50+
"error",
51+
{
52+
"extendDefaultAllowList": true,
53+
"allowList": {
54+
"arg": true,
55+
"i": true
56+
},
57+
"replacements": {
58+
"props": false
59+
}
60+
}
61+
]
62+
},
63+
"overrides": [
64+
{
65+
"files": ["src/background/**"],
66+
"rules": {
67+
"no-restricted-imports": [
68+
"error",
69+
{
70+
"patterns": [
71+
{
72+
"group": ["**/content/**"],
73+
"message": "Modules within /src/background can't import from /src/content"
74+
}
75+
]
76+
}
77+
]
78+
}
79+
},
80+
{
81+
"files": ["src/content/**"],
82+
"rules": {
83+
"no-restricted-imports": [
84+
"error",
85+
{
86+
"patterns": [
87+
{
88+
"group": ["**/background/**"],
89+
"message": "Modules within /src/content can't import from /src/background"
90+
}
91+
]
92+
}
93+
]
94+
}
95+
},
96+
{
97+
"files": ["src/common/**"],
98+
"rules": {
99+
"no-restricted-imports": [
100+
"error",
101+
{
102+
"patterns": [
103+
{
104+
"group": ["**/background/**", "**/content/**"],
105+
"message": "Modules within /src/content can't import from /src/background or /src/content"
106+
}
107+
]
108+
}
109+
]
110+
}
111+
}
112+
]
113+
}

e2e/customHints.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ElementHandle, Frame } from "puppeteer";
1+
import { type ElementHandle, type Frame } from "puppeteer";
22
import { getHintForElement } from "./utils/getHintForElement";
33
import {
44
rangoCommandWithTarget,
@@ -20,7 +20,7 @@ describe("Main frame", () => {
2020
});
2121

2222
test("Extra hints are saved", async () => {
23-
const hintable = await page.$("#custom-button")!;
23+
const hintable = await page.$("#custom-button");
2424
const hint = await hintable!.evaluate(getHintForElement);
2525

2626
await rangoCommandWithTarget("includeExtraSelectors", [hint]);
@@ -68,7 +68,7 @@ describe("iFrame", () => {
6868
});
6969

7070
test("Extra hints are saved", async () => {
71-
const hintable = await frame.$("#custom-button")!;
71+
const hintable = await frame.$("#custom-button");
7272
const hint = await hintable!.evaluate(getHintForElement);
7373

7474
await rangoCommandWithTarget("includeExtraSelectors", [hint]);
@@ -114,7 +114,7 @@ describe("Staging", () => {
114114
});
115115

116116
test("Hints marked are removed after refreshing hints", async () => {
117-
const hintable = await page.$("#custom-button")!;
117+
const hintable = await page.$("#custom-button");
118118
const hint = await hintable!.evaluate(getHintForElement);
119119

120120
await rangoCommandWithTarget("includeExtraSelectors", [hint]);
@@ -132,7 +132,7 @@ describe("Staging", () => {
132132
});
133133

134134
test("Hints marked are removed after custom hints reset", async () => {
135-
const hintable = await page.$("#custom-button")!;
135+
const hintable = await page.$("#custom-button");
136136
const hint = await hintable!.evaluate(getHintForElement);
137137

138138
await rangoCommandWithTarget("includeExtraSelectors", [hint]);

e2e/keyboardClicking.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { keyTap } from "@hurdlegroup/robotjs";
2-
import { Frame, Page } from "puppeteer";
2+
import { type Frame, type Page } from "puppeteer";
33
import { rangoCommandWithoutTarget } from "./utils/rangoCommands";
44
import { sleep } from "./utils/testHelpers";
55

e2e/noContentScript.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import clipboard from "clipboardy";
2-
import { ResponseToTalon } from "../src/typings/RequestFromTalon";
2+
import { type ResponseToTalon } from "../src/typings/RequestFromTalon";
33
import {
44
rangoCommandWithTarget,
55
rangoCommandWithoutTarget,

e2e/scroll.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable max-nested-callbacks */
2-
import { ElementHandle } from "puppeteer";
2+
import { type ElementHandle } from "puppeteer";
33
import {
44
rangoCommandWithoutTarget,
55
rangoCommandWithTarget,
@@ -56,7 +56,7 @@ async function getActionableHint(containerSelector: string, top = true) {
5656
if (visible) $$visible.push($node);
5757
}
5858

59-
const $target = top ? $$visible[0] : $$visible[$$visible.length - 1];
59+
const $target = top ? $$visible[0] : $$visible.at(-1);
6060

6161
return $target!.evaluate(getHintForElement);
6262
}

e2e/utils/testHelpers.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export async function sleep(ms: number) {
2-
return new Promise((r) => {
3-
setTimeout(r, ms);
2+
return new Promise((resolve) => {
3+
setTimeout(resolve, ms);
44
});
55
}

jest-puppeteer.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
product: "chrome",
1010
executablePath: process.env.PUPPETEER_EXEC_PATH,
1111
args: [
12-
"no-sandbox",
12+
"--no-sandbox",
1313
`--disable-extensions-except=${EXTENSION_PATH}`,
1414
`--load-extension=${EXTENSION_PATH}`,
1515
],

0 commit comments

Comments
 (0)