refactor: upgrade eslint 9 and reformat all codes
This commit is contained in:
1 parent
2c35a22c32
commit
deac336fb4
13 files changed
+1638
-2386
No files matched your search
@@ -1,9 +0,0 @@
|
||||
node_modules/
|
||||
buildAssets/icons/
|
||||
dist/
|
||||
release/
|
||||
docs/
|
||||
|
||||
.idea/
|
||||
.vscode/
|
||||
.github/
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "vue-eslint-parser",
|
||||
"parserOptions": {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"sourceType": "module",
|
||||
"ecmaVersion": 2022,
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"extends": ["standard", "plugin:vue/vue3-recommended", "prettier"],
|
||||
"globals": {
|
||||
"__static": true
|
||||
},
|
||||
"plugins": ["vue"],
|
||||
"rules": {
|
||||
"arrow-parens": 0,
|
||||
"generator-star-spacing": 0,
|
||||
"no-case-declarations": 0,
|
||||
"array-callback-return": 0,
|
||||
"no-trailing-spaces": 1,
|
||||
"no-control-regex": 0,
|
||||
"no-useless-constructor": 0,
|
||||
"node/no-deprecated-api": 0
|
||||
}
|
||||
}
|
||||
@@ -57,11 +57,11 @@ order: 1
|
||||
│ └─ testUtil.ts - Test utilities
|
||||
├─ .editorconfig - Editor recommended configuration file for IDE
|
||||
├─ .eslintignore - List of files to be ignored by ESLint
|
||||
├─ .eslintrc.json - ESLint rule configurations
|
||||
├─ .gitignore - List of files to not upload to Git
|
||||
├─ .prettierignore - List of files to disable Prettier file formatting
|
||||
├─ .prettierrc - Prettier rule configurations
|
||||
├─ CODE_OF_CONDUCT.md - Files used only on GitHub
|
||||
├─ eslint.config.ts - ESLint rule configurations
|
||||
├─ LICENSE - Project license file
|
||||
├─ package.json - Node.js package configurations
|
||||
├─ package-lock.json
|
||||
|
||||
@@ -57,11 +57,11 @@ order: 1
|
||||
│ └─ testUtil.ts - 테스트 유틸리티
|
||||
├─ .editorconfig - IDE용 에디터 권장 구성 파일
|
||||
├─ .eslintignore - ESLint에서 무시할 파일 목록
|
||||
├─ .eslintrc.json - ESLint 규칙 구성
|
||||
├─ .gitignore - Git에 업로드하지 않을 파일 목록
|
||||
├─ .prettierignore - Prettier 파일 서식을 비활성화할 파일 목록
|
||||
├─ .prettierrc - Prettier 규칙 설정
|
||||
├─ CODE_OF_CONDUCT.md - GitHub에서만 사용되는 파일
|
||||
├─ eslint.config.ts - ESLint 규칙 구성
|
||||
├─ LICENSE - 프로젝트 라이선스 파일
|
||||
├─ package.json - Node.js 패키지 구성
|
||||
├─ package-lock.json
|
||||
|
||||
@@ -57,11 +57,11 @@ order: 1
|
||||
│ └─ testUtil.ts - 测试实用程序
|
||||
├─ .editorconfig - 编辑器推荐的IDE配置文件
|
||||
├─ .eslintignore - ESLint忽略的文件列表
|
||||
├─ .eslintrc.json - ESLint规则配置
|
||||
├─ .gitignore - 不上传到Git的文件列表
|
||||
├─ .prettierignore - 要禁用的文件列表 更美观的文件格式
|
||||
├─ .prettierrc - 更漂亮的规则配置
|
||||
├─ CODE_OF_CONDUCT.md - 仅在GitHub上使用的文件
|
||||
├─ eslint.config.ts - ESLint规则配置
|
||||
├─ LICENSE - 项目许可证文件
|
||||
├─ package.json - Node.js 包配置
|
||||
├─ package-lock.json
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import { globalIgnores } from 'eslint/config'
|
||||
import pluginJs from '@eslint/js'
|
||||
import pluginTypeScriptESLint from 'typescript-eslint'
|
||||
import parserVue from 'vue-eslint-parser'
|
||||
import parserTypeScript from '@typescript-eslint/parser'
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import pluginNode from 'eslint-plugin-n'
|
||||
import pluginImport from 'eslint-plugin-import'
|
||||
import configPrettier from 'eslint-config-prettier'
|
||||
|
||||
import globals from 'globals'
|
||||
|
||||
export default pluginTypeScriptESLint.config(
|
||||
pluginJs.configs.recommended,
|
||||
pluginTypeScriptESLint.configs.recommended,
|
||||
pluginImport.flatConfigs.electron,
|
||||
pluginNode.configs['flat/recommended-script'],
|
||||
...pluginVue.configs['flat/strongly-recommended'],
|
||||
globalIgnores([
|
||||
'**/node_modules',
|
||||
'**/dist',
|
||||
'**/release',
|
||||
'**/docs',
|
||||
'**/.idea',
|
||||
'**/.vscode',
|
||||
'**/buildAssets/builder',
|
||||
'**/tests/results',
|
||||
'**/package-lock.json'
|
||||
]),
|
||||
{
|
||||
files: ['**/*.{js,mjs,cjs,ts,vue}'],
|
||||
languageOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node
|
||||
},
|
||||
parser: parserVue,
|
||||
parserOptions: {
|
||||
parser: parserTypeScript,
|
||||
ecmaVersion: 2022,
|
||||
ecmaFeatures: {
|
||||
jsx: true
|
||||
},
|
||||
requireConfigFile: false
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
// override/add rules settings here, such as:
|
||||
eqeqeq: 'error',
|
||||
'no-unused-vars': 'off',
|
||||
'no-case-declarations': 'off',
|
||||
'no-trailing-spaces': 'error',
|
||||
'no-unsafe-optional-chaining': 'off',
|
||||
'no-control-regex': 'off',
|
||||
'n/no-missing-import': 'off',
|
||||
'n/no-unsupported-features/node-builtins': 'off',
|
||||
'vue/v-on-event-hyphenation': 'off',
|
||||
'vue/no-v-text-v-html-on-component': 'off',
|
||||
'vue/attribute-hyphenation': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'warn'
|
||||
}
|
||||
},
|
||||
configPrettier
|
||||
)
|
||||
Generated
+1545
-2322
File diff suppressed because it is too large.
Load diff
+16
-15
@@ -31,8 +31,8 @@
|
||||
"build:mac": "npm run build:pre && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --config=buildAssets/builder/config.js --mac",
|
||||
"build:linux": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js --linux",
|
||||
"build:win": "npm run build:pre && electron-builder --config=buildAssets/builder/config.js --windows",
|
||||
"lint": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter src",
|
||||
"lint:fix": "eslint --ext .js,.ts,.vue -f ./node_modules/eslint-friendly-formatter --fix src",
|
||||
"lint": "eslint . --ext .js,.ts,.vue src",
|
||||
"lint:fix": "eslint . --ext .js,.ts,.vue --fix src",
|
||||
"format": "prettier .",
|
||||
"format:fix": "prettier . --write",
|
||||
"test": "npm run build:pre && playwright test",
|
||||
@@ -50,33 +50,34 @@
|
||||
"vuetify": "^3.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.24.0",
|
||||
"@playwright/test": "^1.52.0",
|
||||
"@typescript-eslint/eslint-plugin": "7.16.1",
|
||||
"@typescript-eslint/parser": "7.16.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.30.1",
|
||||
"@typescript-eslint/parser": "^8.30.1",
|
||||
"@vitejs/plugin-vue": "^5.2.3",
|
||||
"@vitejs/plugin-vue-jsx": "^4.1.2",
|
||||
"dotenv": "^16.5.0",
|
||||
"electron": "^35.1.5",
|
||||
"electron-builder": "^26.0.12",
|
||||
"electron-extension-installer": "^1.2.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-config-standard": "17.1.0",
|
||||
"eslint-friendly-formatter": "4.0.1",
|
||||
"eslint-plugin-import": "2.30.0",
|
||||
"eslint-plugin-n": "16.6.2",
|
||||
"eslint-plugin-promise": "6.4.0",
|
||||
"eslint-plugin-vue": "9.28.0",
|
||||
"eslint": "^9.24.0",
|
||||
"eslint-config-prettier": "^10.1.2",
|
||||
"eslint-plugin-import": "^2.31.0",
|
||||
"eslint-plugin-n": "^17.17.0",
|
||||
"eslint-plugin-vue": "^10.0.0",
|
||||
"globals": "^16.0.0",
|
||||
"jiti": "^2.4.2",
|
||||
"playwright": "^1.52.0",
|
||||
"prettier": "^3.5.3",
|
||||
"tree-kill": "^1.2.2",
|
||||
"typescript": "5.8.3",
|
||||
"typescript": "^5.8.3",
|
||||
"typescript-eslint": "^8.30.1",
|
||||
"vite": "^6.3.1",
|
||||
"vite-plugin-electron": "^0.29.0",
|
||||
"vite-plugin-electron-renderer": "^0.14.6",
|
||||
"vite-plugin-eslint": "1.8.1",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-plugin-vuetify": "^2.1.1",
|
||||
"vue-eslint-parser": "9.4.3",
|
||||
"vue-eslint-parser": "^10.1.3",
|
||||
"vue-tsc": "^2.2.8"
|
||||
},
|
||||
"overrides": {
|
||||
|
||||
@@ -116,6 +116,7 @@ export const createMainWindow = async (): Promise<BrowserWindow> => {
|
||||
export const createErrorWindow = async (
|
||||
errorWindow: BrowserWindow,
|
||||
mainWindow: BrowserWindow,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
details?: RenderProcessGoneDetails
|
||||
): Promise<BrowserWindow> => {
|
||||
if (!Constants.IS_DEV_ENV) {
|
||||
|
||||
+2
-2
@@ -38,10 +38,10 @@ export function createTray(window: BrowserWindow, options) {
|
||||
tray.setContextMenu(contextMenu)
|
||||
} else {
|
||||
// handle click on tray icon
|
||||
tray.on('right-click', function (event) {
|
||||
tray.on('right-click', function () {
|
||||
debounce(() => toggleWindow(window))
|
||||
})
|
||||
tray.on('click', function (event) {
|
||||
tray.on('click', function () {
|
||||
debounce(() => toggleWindow(window))
|
||||
})
|
||||
// no menu for tray window
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export default class TestUtil {
|
||||
const screenshotPath = `${this._testScreenshotPath}/${screenshotName || `unknown_${Date.now()}`}.png`
|
||||
|
||||
await pageInstance.screenshot({ path: screenshotPath })
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,8 +3,8 @@
|
||||
"baseUrl": "./",
|
||||
"outDir": "./dist",
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"module": "nodenext",
|
||||
"moduleResolution": "nodenext",
|
||||
"jsx": "preserve",
|
||||
"noImplicitAny": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
|
||||
+2
-1
@@ -3,7 +3,7 @@
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"jsx": "preserve",
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "nodenext",
|
||||
"composite": true,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
@@ -14,6 +14,7 @@
|
||||
"src/main",
|
||||
"src/preload",
|
||||
"package.json",
|
||||
"eslint.config.ts",
|
||||
"vite.config.mts",
|
||||
"buildAssets/builder",
|
||||
"tests/**/*.ts",
|
||||
|
||||
Reference in new issue
Block a user