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

Bump node to 18 #57

Merged
merged 4 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
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 }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need this and eslint-jest-plugin because eslint-config-preact requires it 😑
preactjs/eslint-config-preact#19 (comment)

},
"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
5,885 changes: 4,462 additions & 1,423 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,24 @@
"@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",
"@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",
"tiny-typed-emitter": "^2.1.0",
"ts-loader": "^8.1.0",
"ts-node": "^9.1.1",
"typescript": "^4.2.4",
"web-ext": "^7.11.0",
"webpack": "^5.30.0",
"webpack": "^5.91.0",
"webpack-cli": "^4.6.0"
},
"dependencies": {
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
Loading