Skip to content

Commit

Permalink
Merge pull request #57 from HarlemSquirrel/node-18
Browse files Browse the repository at this point in the history
Bump node to 18
  • Loading branch information
HarlemSquirrel authored May 17, 2024
2 parents 281ed9f + 56f647d commit 471cd3b
Show file tree
Hide file tree
Showing 12 changed files with 4,810 additions and 1,814 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
}
},
"jest": { "version": 27 }
},
"rules": {
"semi": ["error", "always"],
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.20.2
v18.20.2
6,571 changes: 4,783 additions & 1,788 deletions package-lock.json

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,27 @@
"devDependencies": {
"@types/chrome": "^0.0.134",
"@types/copy-webpack-plugin": "^8.0.0",
"@types/node": "^15.0.1",
"@types/webpack": "^5.28.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@types/node": "^20.12.10",
"@types/webpack": "^5.28.5",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"copy-webpack-plugin": "^8.1.0",
"cross-env": "^7.0.3",
"eslint": "^7.23.0",
"eslint-config-preact": "^1.1.3",
"eslint-config-preact": "^1.3.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-prettier": "^3.3.1",
"merge": "^2.1.1",
"prettier": "^2.8.8",
"tiny-typed-emitter": "^2.0.3",
"ts-loader": "^8.1.0",
"ts-node": "^9.1.1",
"tiny-typed-emitter": "^2.1.0",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^4.2.4",
"web-ext": "^7.11.0",
"webpack": "^5.30.0",
"webpack-cli": "^4.6.0"
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"preact": "^10.5.13",
Expand Down
5 changes: 0 additions & 5 deletions scripts/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"parserOptions": {
"project": [
"../tsconfig.json"
]
},
"rules": {
"no-console": "off",
"import/no-namespace": "off",
Expand Down
8 changes: 4 additions & 4 deletions scripts/download-translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ async function loadLanguages(): Promise<Languages> {
}
const data: Buffer[] = [];
res.on('error', reject);
res.on('data', (chunk) => data.push(chunk));
res.on('data', (chunk) => data.push(chunk as Buffer));
res.on('end', () => {
if (res.statusCode !== 200) {
return reject(new Error(`API error ${res.statusCode}`));
}
try {
const json = Buffer.concat(data).toString('utf8');
const parsed = JSON.parse(json);
const parsed = JSON.parse(json) as Languages;
if (USE_FILES) {
fs.writeFileSync(CACHE_FILE_LANGUAGES, JSON.stringify(parsed, null, 2));
}
Expand Down Expand Up @@ -121,11 +121,11 @@ async function loadTranslations(): Promise<Translations> {
return reject(new Error(`API error ${res.statusCode}`));
}
const data: Buffer[] = [];
res.on('data', (chunk) => data.push(chunk));
res.on('data', (chunk) => data.push(chunk as Buffer));
res.on('end', () => {
try {
const json = Buffer.concat(data).toString('utf8');
const parsed = JSON.parse(json);
const parsed = JSON.parse(json) as Translations;
if (USE_FILES) {
fs.writeFileSync(CACHE_FILE_TRANSLATIONS, JSON.stringify(parsed, null, 2));
}
Expand Down
2 changes: 1 addition & 1 deletion src/background/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class Backend extends TypedEmitter<BackendEvents> {
this._connectionError = (<Error>e).message;
this.setState(BackendConnectionState.Error);

this.emit('connect-finished', e);
this.emit('connect-finished', <Error>e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/background/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function sendMessageToTab(
if (chrome.runtime.lastError) {
return resolve(undefined);
}
resolve(resp);
resolve(resp); // eslint-disable-line @typescript-eslint/no-unsafe-argument
});
});
}
Expand Down
4 changes: 4 additions & 0 deletions src/background/protocol/protocol-impl.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */

import {
KeeWebConnectRequest,
KeeWebConnectResponse,
Expand Down Expand Up @@ -314,4 +316,6 @@ class ProtocolImpl {
}
}

/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */

export { ProtocolImpl };
2 changes: 1 addition & 1 deletion src/background/transport/transport-browser-tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class TransportBrowserTab extends TransportBase {
}

this._port.onDisconnect.addListener(() => this.portDisconnected());
this._port.onMessage.addListener((msg) => this.portMessage(msg));
this._port.onMessage.addListener((msg) => this.portMessage(msg)); // eslint-disable-line @typescript-eslint/no-unsafe-argument
}

disconnect(): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion src/background/transport/transport-native-messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TransportNativeMessaging extends TransportBase {
this._port = chrome.runtime.connectNative(this._appName);

this._port.onDisconnect.addListener(() => this.portDisconnected());
this._port.onMessage.addListener((msg) => this.portMessage(msg));
this._port.onMessage.addListener((msg) => this.portMessage(msg)); // eslint-disable-line @typescript-eslint/no-unsafe-argument

return Promise.resolve();
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/content-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (!window.kwExtensionInstalled) {
return;
}

const response = run(message);
const response = run(message as ContentScriptMessage);
if (response) {
sendResponse(response);
}
Expand Down

0 comments on commit 471cd3b

Please sign in to comment.