Skip to content

Commit a2eb3a6

Browse files
chore(deps): update dependency eslint to v9 (v2) (#1424)
* chore(deps): update dependency eslint to v9 * flat config * license header * rebuild --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars <[email protected]>
1 parent 60a8545 commit a2eb3a6

File tree

13 files changed

+243
-1068
lines changed

13 files changed

+243
-1068
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
2+
// SPDX-License-Identifier: Apache-2.0
3+
// SPDX-License-Identifier: MIT
4+
5+
import eslint from "@eslint/js";
6+
import eslintConfigPrettier from "eslint-config-prettier";
7+
import eslintPluginSecurity from "eslint-plugin-security";
8+
import tseslint from "typescript-eslint";
9+
10+
export default tseslint.config(
11+
{
12+
ignores: [
13+
"**/target",
14+
"**/node_modules",
15+
"**/examples",
16+
"**/dist",
17+
"**/dist-js",
18+
"**/build",
19+
"**/api-iife.js",
20+
"**/init-iife.js",
21+
"**/init.js",
22+
"**/rollup.config.js",
23+
".scripts",
24+
"eslint.config.js",
25+
],
26+
},
27+
eslint.configs.recommended,
28+
eslintConfigPrettier,
29+
eslintPluginSecurity.configs.recommended,
30+
...tseslint.configs.recommendedTypeChecked,
31+
{
32+
languageOptions: {
33+
parserOptions: { project: true, tsconfigRootDir: import.meta.dirname },
34+
},
35+
},
36+
);

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,20 @@
1010
"format-check": "prettier --check \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\" --ignore-path .prettierignore"
1111
},
1212
"devDependencies": {
13+
"@eslint/js": "9.4.0",
1314
"@rollup/plugin-node-resolve": "15.2.3",
1415
"@rollup/plugin-terser": "0.4.4",
1516
"@rollup/plugin-typescript": "11.1.6",
16-
"@typescript-eslint/eslint-plugin": "7.11.0",
17-
"@typescript-eslint/parser": "7.11.0",
17+
"@types/eslint__js": "8.42.3",
1818
"covector": "^0.11.0",
19-
"eslint": "8.57.0",
19+
"eslint": "9.4.0",
2020
"eslint-config-prettier": "9.1.0",
21-
"eslint-plugin-import": "2.29.1",
22-
"eslint-plugin-n": "17.7.0",
23-
"eslint-plugin-promise": "6.2.0",
2421
"eslint-plugin-security": "3.0.0",
2522
"prettier": "3.3.0",
2623
"rollup": "4.18.0",
2724
"tslib": "2.6.2",
28-
"typescript": "5.4.5"
25+
"typescript": "5.4.5",
26+
"typescript-eslint": "rc-v8"
2927
},
3028
"resolutions": {
3129
"semver": ">=7.5.2",

plugins/dialog/guest-js/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ type OpenDialogReturn<T extends OpenDialogOptions> = T["directory"] extends true
163163
* @since 2.0.0
164164
*/
165165
async function open<T extends OpenDialogOptions>(
166-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
167166
options: T = {} as T,
168167
): Promise<OpenDialogReturn<T>> {
169168
if (typeof options === "object") {

plugins/fs/guest-js/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,6 @@ async function readTextFileLines(
777777
if (done) this.rid = null;
778778

779779
return {
780-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
781780
value: done ? "" : line!,
782781
done,
783782
};

plugins/http/guest-js/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export async function fetch(
141141
? headers
142142
: Object.entries(headers);
143143

144+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
144145
const mappedHeaders: Array<[string, string]> = headersArray.map(
145146
([name, val]) => [
146147
name,

plugins/notification/guest-js/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,8 @@ async function requestPermission(): Promise<Permission> {
364364
*/
365365
function sendNotification(options: Options | string): void {
366366
if (typeof options === "string") {
367-
// eslint-disable-next-line no-new
368367
new window.Notification(options);
369368
} else {
370-
// eslint-disable-next-line no-new
371369
new window.Notification(options.title, options);
372370
}
373371
}

plugins/notification/guest-js/init.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ import type { Options } from "./index";
5757

5858
// @ts-expect-error unfortunately we can't implement the whole type, so we overwrite it with our own version
5959
window.Notification = function (title, options) {
60-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
60+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
6161
const opts = options || {};
6262
void sendNotification(
6363
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
6464
Object.assign(opts, {
65+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
6566
title,
6667
}),
6768
);
@@ -77,6 +78,7 @@ import type { Options } from "./index";
7778
if (!permissionSettable) {
7879
throw new Error("Readonly property");
7980
}
81+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
8082
permissionValue = v;
8183
},
8284
});

plugins/shell/guest-js/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ class EventEmitter<E extends Record<string, any>> {
171171
): this {
172172
const wrapper = (arg: E[typeof eventName]): void => {
173173
this.removeListener(eventName, wrapper);
174-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
175174
listener(arg);
176175
};
177176
return this.addListener(eventName, wrapper);
@@ -204,9 +203,8 @@ class EventEmitter<E extends Record<string, any>> {
204203
* @since 2.0.0
205204
*/
206205
removeAllListeners<N extends keyof E>(event?: N): this {
207-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
208206
if (event) {
209-
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete,security/detect-object-injection
207+
// eslint-disable-next-line security/detect-object-injection
210208
delete this.eventListeners[event];
211209
} else {
212210
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -226,9 +224,8 @@ class EventEmitter<E extends Record<string, any>> {
226224
*/
227225
emit<N extends keyof E>(eventName: N, arg: E[typeof eventName]): boolean {
228226
if (eventName in this.eventListeners) {
229-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,security/detect-object-injection
227+
// eslint-disable-next-line security/detect-object-injection
230228
const listeners = this.eventListeners[eventName];
231-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
232229
for (const listener of listeners) listener(arg);
233230
return true;
234231
}

0 commit comments

Comments
 (0)