Skip to content

Commit 6545d0c

Browse files
committed
fix: update compiler target to es2022 and remove @ts-ignore (fixes #810)
- Update jsconfig.json target from es2017 to es2022 - Remove all @ts-ignore comments; linter and tests pass without them Made-with: Cursor
1 parent 6987b4d commit 6545d0c

Some content is hidden

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

51 files changed

+1
-145
lines changed

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"checkJs": true,
4-
"target": "es2017",
4+
"target": "es2022",
55
"module": "nodenext",
66
"moduleResolution": "nodenext",
77
"resolveJsonModule": true,

src/extension/actions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,6 @@ export async function checkViewDocSource(id) {
458458
const u = new URL(tab.url);
459459
const vds = u.searchParams.get('view-doc-source');
460460
if (vds && vds === 'true') {
461-
// @ts-ignore
462461
await openViewDocSource({ id });
463462
}
464463
} catch (e) {

src/extension/app/components/plugin/plugin-action-bar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ export class PluginActionBar extends ConnectedElement {
361361

362362
// istanbul ignore next 7
363363
async onPluginMenuSelect() {
364-
// @ts-ignore
365364
const pluginMenu = await this.pluginMenu;
366365
if (pluginMenu) {
367366
pluginMenu.value = '';

src/extension/app/store/site.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ export class SiteStore {
347347
ref: this.ref,
348348
giturl: this.giturl,
349349
devUrl: this.devUrl.href,
350-
// @ts-ignore
351350
mountpoint: this.mountpoint,
352351
mountpoints: this.mountpoints,
353352
project: this.project,

src/extension/auth.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ export async function updateUserAgent() {
264264
},
265265
}];
266266

267-
// @ts-ignore
268267
await chrome.declarativeNetRequest.updateDynamicRules({ addRules });
269268
log.debug(`updateUserAgent: ${userAgent}`);
270269
}

src/extension/project.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ export async function detectLegacySidekick() {
563563
extensionIds.map(
564564
async (id) => new Promise((resolve) => {
565565
try {
566-
// @ts-ignore
567566
chrome.runtime.lastError = null;
568567
chrome.runtime.sendMessage(
569568
id,

src/extension/ui.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ function getPaths(type) {
5757
for (const size of ICON_SIZES) {
5858
paths[size] = `icons/${type}/icon-${size}x${size}.png`;
5959
}
60-
// @ts-ignore
6160
return paths;
6261
}
6362

@@ -223,7 +222,6 @@ if (chrome.contextMenus) {
223222
window.hlx = window.hlx || {};
224223
window.hlx.sidekick = window.hlx.sidekick || { location: window.location };
225224

226-
// @ts-ignore
227225
const action = `${menuItemIdVal}`.replaceAll(/([A-Z])/g, `-${'$1'}`).toLowerCase();
228226
sampleRUM('click', {
229227
source: 'sidekick',

src/extension/url-cache.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ class UrlCache {
197197
*/
198198
async set(tab, config = {}) {
199199
const { url } = tab;
200-
// @ts-ignore
201200
const { owner, repo } = config;
202201
const createCacheEntry = (cacheUrl, results, expiry = 0) => {
203202
const entry = { url: cacheUrl, results };
@@ -252,7 +251,6 @@ class UrlCache {
252251
});
253252
}
254253
const resp = await callAdmin(
255-
// @ts-ignore
256254
{ apiUpgrade: true }, 'discover', '', { searchParams },
257255
);
258256
if (resp.ok) {

src/extension/utils/rum.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export default function sampleRUM(checkpoint, data = {}) {
5757
// eslint-disable-next-line no-unused-expressions
5858
navigator.sendBeacon(url, body);
5959
};
60-
// @ts-ignore
6160
sendPing(data);
6261
}
6362
} catch (error) {

src/extension/views/doc-source/js/ui.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ const load = async () => {
245245
});
246246
});
247247

248-
// @ts-ignore
249248
editor.addEventListener('input', debounce(() => {
250249
sendMessage({ fct: 'setMain', params: { html: htmlEditionToSource() } });
251250
}, 500));

0 commit comments

Comments
 (0)