Skip to content

Commit b1c70c8

Browse files
chore(deps): update dependency eslint-config-prettier to v10 (#254)
* chore(deps): update dependency eslint-config-prettier to v10 * Mimic searchengine-devtools * Prettier format * Fix var renaming --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Mathieu Leplatre <mathieu@mozilla.com>
1 parent 3e2ade6 commit b1c70c8

10 files changed

Lines changed: 3767 additions & 1508 deletions

File tree

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import globals from "globals";
2+
import json from "eslint-plugin-json";
3+
import mozilla from "eslint-plugin-mozilla";
4+
import pluginJest from "eslint-plugin-jest";
5+
6+
export default [
7+
{
8+
ignores: [
9+
"node_modules/",
10+
"web-ext-artifacts/",
11+
"extension/content/*.min.js",
12+
],
13+
},
14+
{
15+
languageOptions: {
16+
globals: {
17+
...globals.es2024,
18+
},
19+
},
20+
},
21+
...mozilla.configs["flat/recommended"],
22+
{
23+
files: ["**/*.json"],
24+
plugins: { json },
25+
processor: json.processors[".json"],
26+
rules: json.configs.recommended.rules,
27+
},
28+
{
29+
files: ["extension/**"],
30+
languageOptions: {
31+
globals: {
32+
...globals.webextensions,
33+
},
34+
},
35+
},
36+
{
37+
files: ["extension/content/*.js"],
38+
languageOptions: {
39+
globals: {
40+
...globals.browser,
41+
},
42+
},
43+
},
44+
{
45+
files: ["extension/experiments/**/*.js"],
46+
languageOptions: {
47+
sourceType: "script",
48+
globals: {
49+
...mozilla.environments.privileged.globals,
50+
},
51+
},
52+
},
53+
{
54+
files: [
55+
"tests/*.spec.js",
56+
],
57+
languageOptions: {
58+
sourceType: "module",
59+
globals: {
60+
...globals.node,
61+
...pluginJest.environments.globals.globals,
62+
},
63+
},
64+
},
65+
{
66+
files: [
67+
".prettierrc.js",
68+
],
69+
languageOptions: {
70+
sourceType: "script",
71+
globals: {
72+
...globals.node,
73+
},
74+
},
75+
},
76+
];

extension/.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

extension/content/script.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,13 @@ async function refreshUI(state) {
117117

118118
statusTable.innerHTML = "";
119119
collections.forEach((status) => {
120-
const { bucket, collection, lastCheck, localTimestamp, serverTimestamp } =
121-
status;
120+
const {
121+
bucket,
122+
collection,
123+
lastCheck: lastCheckCollection,
124+
localTimestamp: localTimestampCollection,
125+
serverTimestamp: serverTimestampCollection,
126+
} = status;
122127
const url = `${serverURL}/buckets/${bucket}/collections/${collection}/changeset?_expected=${serverTimestamp}`;
123128
const identifier = `${bucket}/${collection}`;
124129

@@ -127,16 +132,21 @@ async function refreshUI(state) {
127132
tableRow.querySelector("tr").setAttribute("id", tableRowId);
128133
tableRow.querySelector(".url").textContent = identifier;
129134
tableRow.querySelector(".url").setAttribute("href", url);
130-
tableRow.querySelector(".human-server-timestamp").textContent =
131-
humanDate(serverTimestamp);
132-
tableRow.querySelector(".server-timestamp").textContent = serverTimestamp;
135+
tableRow.querySelector(".human-server-timestamp").textContent = humanDate(
136+
serverTimestampCollection,
137+
);
138+
tableRow.querySelector(".server-timestamp").textContent =
139+
serverTimestampCollection;
133140
tableRow.querySelector(".human-local-timestamp").className +=
134-
localTimestamp == serverTimestamp ? " up-to-date" : " unsync";
135-
tableRow.querySelector(".human-local-timestamp").textContent =
136-
humanDate(localTimestamp);
141+
localTimestampCollection == serverTimestampCollection
142+
? " up-to-date"
143+
: " unsync";
144+
tableRow.querySelector(".human-local-timestamp").textContent = humanDate(
145+
localTimestampCollection,
146+
);
137147
tableRow.querySelector(".local-timestamp").textContent = localTimestamp;
138148
tableRow.querySelector(".last-check").textContent = humanDate(
139-
lastCheck * 1000,
149+
lastCheckCollection * 1000,
140150
);
141151

142152
tableRow.querySelector("button.clear-data").onclick = async () => {

extension/experiments/.eslintrc.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

extension/experiments/remotesettings/api.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ ChromeUtils.defineESModuleGetters(this, {
22
RemoteSettings: "resource://services-settings/remote-settings.sys.mjs",
33
});
44

5+
/* global ExtensionAPI, ExtensionCommon, ExtensionUtils, Services */
6+
57
const { EventManager } = ExtensionCommon;
68
const { ExtensionError } = ExtensionUtils;
79

0 commit comments

Comments
 (0)