Skip to content

Commit

Permalink
refactor: 📦️ update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
caorushizi committed May 26, 2024
1 parent a4cd419 commit 4d76029
Show file tree
Hide file tree
Showing 18 changed files with 152 additions and 1,473 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

20 changes: 0 additions & 20 deletions .eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";

export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
14 changes: 5 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/core": "^19.3.0",
"@commitlint/cz-commitlint": "^19.2.0",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"@commitlint/format": "^19.3.0",
"@eslint/js": "^9.3.0",
"@waline/client": "^3.2.0",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"cspell": "^8.8.3",
"cz-git": "^1.9.1",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"globals": "^15.3.0",
"husky": "^9.0.11",
"prettier": "3.2.5",
"tsx": "^4.11.0",
"typescript-eslint": "^7.10.0",
"vitepress": "1.2.2",
"vue": "^3.4.27",
"zx": "^8.1.1"
Expand All @@ -57,9 +57,5 @@
"patchedDependencies": {
"@cliqz/[email protected]": "patches/@[email protected]"
}
},
"dependencies": {
"@commitlint/core": "^19.3.0",
"@commitlint/format": "^19.3.0"
}
}
1 change: 0 additions & 1 deletion packages/main/.eslintignore

This file was deleted.

23 changes: 0 additions & 23 deletions packages/main/.eslintrc.cjs

This file was deleted.

11 changes: 11 additions & 0 deletions packages/main/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";

export default [
{
languageOptions: { globals: globals.node },
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
15 changes: 4 additions & 11 deletions packages/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"license": "MIT",
"devDependencies": {
"@electron/rebuild": "^3.6.0",
"@rushstack/eslint-patch": "^1.10.3",
"@eslint/js": "^9.3.0",
"@types/electron-devtools-installer": "^2.2.5",
"@types/fs-extra": "^11.0.4",
"@types/gulp": "^4.0.17",
Expand All @@ -30,8 +30,6 @@
"@types/node": "^20.12.12",
"@types/node-fetch": "^2.6.11",
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"consola": "^3.2.3",
"cross-env": "^7.0.3",
"del": "^7.1.0",
Expand All @@ -42,17 +40,12 @@
"esbuild": "^0.21.4",
"esbuild-register": "^3.5.0",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-n": "17.7.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "6.1.1",
"globals": "^15.3.0",
"gulp": "^5.0.0",
"prebuild-install": "^7.1.2",
"prettier": "3.2.5",
"semver": "^7.6.2",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"typescript-eslint": "^7.10.0"
},
"dependencies": {
"@cliqz/adblocker-electron": "^1.27.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/main/src/windows/BrowserWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export default class BrowserWindow extends Window {
this.store.onDidAnyChange(this.storeChange);
}

storeChange = (store: any) => {
storeChange = (store: unknown) => {
this.send("store-change", store);
};

handleNewWindowsVal = (newValue: any) => {
handleNewWindowsVal = (newValue: unknown) => {
if (!this.window) return;

// 向所有窗口发送通知
Expand Down Expand Up @@ -75,7 +75,7 @@ export default class BrowserWindow extends Window {
this.window.close();
};

send(channel: string, ...args: any[]) {
send(channel: string, ...args: unknown[]) {
if (!this.window) return;

this.window.webContents.send(channel, ...args);
Expand Down
6 changes: 3 additions & 3 deletions packages/main/src/windows/MainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default class MainWindow extends Window {
}
};

storeChange = (store: any) => {
storeChange = (store: unknown) => {
// 向所有窗口发送通知
this.send("store-change", store);
};
Expand All @@ -121,7 +121,7 @@ export default class MainWindow extends Window {
this.send("download-success", id);
};

onDownloadFailed = async (id: number, err: any) => {
onDownloadFailed = async (id: number, err: unknown) => {
const promptTone = this.store.get("promptTone");
if (promptTone) {
const video = await this.videoRepository.findVideo(id);
Expand Down Expand Up @@ -152,7 +152,7 @@ export default class MainWindow extends Window {
}
};

send(channel: string, ...args: any[]) {
send(channel: string, ...args: unknown[]) {
if (!this.window) return;

this.window.webContents.send(channel, ...args);
Expand Down
22 changes: 0 additions & 22 deletions packages/plugin/.eslintrc.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions packages/plugin/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";

export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
];
8 changes: 3 additions & 5 deletions packages/plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
"nanoid": "^5.0.7"
},
"devDependencies": {
"@eslint/js": "^9.3.0",
"@types/jquery": "^3.5.30",
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.10.0",
"@typescript-eslint/parser": "^7.10.0",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"globals": "^15.3.0",
"lint-staged": "^15.2.5",
"prettier": "3.2.5",
"stylelint": "^16.6.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard-scss": "^13.1.0",
"typescript": "^5.4.5",
"typescript-eslint": "^7.10.0",
"vite": "^5.2.11"
},
"lint-staged": {
Expand Down
Empty file removed packages/renderer/.eslintignore
Empty file.
24 changes: 0 additions & 24 deletions packages/renderer/.eslintrc.cjs

This file was deleted.

12 changes: 12 additions & 0 deletions packages/renderer/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReactConfig from "eslint-plugin-react/configs/recommended.js";
import { fixupConfigRules } from "@eslint/compat";

export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...fixupConfigRules(pluginReactConfig),
];
12 changes: 4 additions & 8 deletions packages/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"sort-by": "^1.2.0"
},
"devDependencies": {
"@eslint/compat": "^1.0.1",
"@eslint/js": "^9.3.0",
"@types/node": "^20.12.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
Expand All @@ -46,19 +48,13 @@
"@typescript-eslint/parser": "7.10.0",
"@vitejs/plugin-react-swc": "^3.7.0",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^17.7.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.34.1",
"prettier": "3.2.5",
"globals": "^15.3.0",
"sass": "^1.77.2",
"stylelint": "^16.6.0",
"stylelint-config-standard": "^36.0.0",
"stylelint-config-standard-scss": "^13.1.0",
"typescript": "~5.4.5",
"typescript-eslint": "^7.10.0",
"vite": "^5.2.11",
"vite-bundle-visualizer": "^1.2.1"
},
Expand Down
Loading

0 comments on commit 4d76029

Please sign in to comment.