build(projects): 升级依赖,添加对json的eslint检测及格式化

This commit is contained in:
Soybean 2022-07-14 00:02:00 +08:00
parent d9cfeabb47
commit 711a4ae34f
8 changed files with 847 additions and 845 deletions

View File

@ -11,6 +11,5 @@ lib
/docs /docs
.vscode .vscode
.local .local
package.json
!.env-config.ts !.env-config.ts
components.d.ts components.d.ts

View File

@ -38,6 +38,12 @@ module.exports = {
rules: { rules: {
'vue/comment-directive': 'off' 'vue/comment-directive': 'off'
} }
},
{
files: ['*.json'],
rules: {
'no-unused-expressions': 'off'
}
} }
], ],
settings: { settings: {

View File

@ -9,6 +9,8 @@
"strings": true "strings": true
}, },
"editor.tabSize": 2, "editor.tabSize": 2,
"eslint.alwaysShowStatus": true,
"eslint.validate": ["javascript", "javascriptreact", "vue", "typescript", "typescriptreact", "html", "json", "jsonc"],
"files.associations": { "files.associations": {
"*.env.*": "dotenv" "*.env.*": "dotenv"
}, },
@ -48,10 +50,10 @@
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[json]": { "[json]": {
"editor.defaultFormatter": "vscode.json-language-features" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[jsonc]": { "[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[javascript]": { "[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"

View File

@ -16,14 +16,14 @@
"build:vercel": "cross-env VITE_HASH_ROUTE=1 VITE_VERCEL=1 vite build", "build:vercel": "cross-env VITE_HASH_ROUTE=1 VITE_VERCEL=1 vite build",
"preview": "vite preview", "preview": "vite preview",
"typecheck": "vue-tsc --noEmit --skipLibCheck", "typecheck": "vue-tsc --noEmit --skipLibCheck",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.json --fix",
"prepare": "husky install", "prepare": "husky install",
"postinstall": "patch-package", "postinstall": "patch-package",
"release": "standard-version", "release": "standard-version",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md" "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
}, },
"lint-staged": { "lint-staged": {
"*.{vue,js,jsx,ts,tsx}": "eslint --fix" "*.{vue,js,jsx,ts,tsx,json}": "eslint --fix"
}, },
"config": { "config": {
"commitizen": { "commitizen": {
@ -46,10 +46,10 @@
"form-data": "^4.0.0", "form-data": "^4.0.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"naive-ui": "^2.31.0", "naive-ui": "^2.31.0",
"pinia": "^2.0.15", "pinia": "^2.0.16",
"print-js": "^1.6.0", "print-js": "^1.6.0",
"qs": "^6.11.0", "qs": "^6.11.0",
"swiper": "^8.3.0", "swiper": "^8.3.1",
"ua-parser-js": "^1.0.2", "ua-parser-js": "^1.0.2",
"vditor": "^3.8.15", "vditor": "^3.8.15",
"vue": "3.2.37", "vue": "3.2.37",
@ -61,7 +61,7 @@
"@amap/amap-jsapi-types": "^0.0.8", "@amap/amap-jsapi-types": "^0.0.8",
"@commitlint/cli": "^17.0.3", "@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3", "@commitlint/config-conventional": "^17.0.3",
"@iconify/json": "^2.1.76", "@iconify/json": "^2.1.77",
"@iconify/vue": "^3.2.1", "@iconify/vue": "^3.2.1",
"@types/bmapgl": "^0.0.5", "@types/bmapgl": "^0.0.5",
"@types/crypto-js": "^4.1.1", "@types/crypto-js": "^4.1.1",
@ -70,8 +70,8 @@
"@types/ua-parser-js": "^0.7.36", "@types/ua-parser-js": "^0.7.36",
"@typescript-eslint/eslint-plugin": "^5.30.6", "@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6", "@typescript-eslint/parser": "^5.30.6",
"@vitejs/plugin-vue": "^2.3.3", "@vitejs/plugin-vue": "^3.0.0",
"@vitejs/plugin-vue-jsx": "^1.3.10", "@vitejs/plugin-vue-jsx": "^2.0.0",
"@vue/eslint-config-prettier": "^7.0.0", "@vue/eslint-config-prettier": "^7.0.0",
"@vue/eslint-config-typescript": "^11.0.0", "@vue/eslint-config-typescript": "^11.0.0",
"commitizen": "^4.2.4", "commitizen": "^4.2.4",
@ -99,7 +99,7 @@
"unplugin-icons": "^0.14.7", "unplugin-icons": "^0.14.7",
"unplugin-vue-components": "0.21.1", "unplugin-vue-components": "0.21.1",
"unplugin-vue-define-options": "^0.6.2", "unplugin-vue-define-options": "^0.6.2",
"vite": "^2.9.14", "vite": "^3.0.0",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-html": "^3.2.0", "vite-plugin-html": "^3.2.0",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",

File diff suppressed because it is too large Load Diff

View File

@ -1,145 +1,145 @@
{ {
"darkMode": false, "darkMode": false,
"followSystemTheme": true, "followSystemTheme": true,
"layout": { "layout": {
"minWidth": 900, "minWidth": 900,
"mode": "vertical", "mode": "vertical",
"modeList": [ "modeList": [
{ {
"value": "vertical", "value": "vertical",
"label": "左侧菜单模式" "label": "左侧菜单模式"
}, },
{ {
"value": "vertical-mix", "value": "vertical-mix",
"label": "左侧菜单混合模式" "label": "左侧菜单混合模式"
}, },
{ {
"value": "horizontal", "value": "horizontal",
"label": "顶部菜单模式" "label": "顶部菜单模式"
}, },
{ {
"value": "horizontal-mix", "value": "horizontal-mix",
"label": "顶部菜单混合模式" "label": "顶部菜单混合模式"
} }
] ]
}, },
"themeColor": "#1890ff", "themeColor": "#1890ff",
"themeColorList": [ "themeColorList": [
"#1890ff", "#1890ff",
"#409EFF", "#409EFF",
"#2d8cf0", "#2d8cf0",
"#007AFF", "#007AFF",
"#5ac8fa", "#5ac8fa",
"#5856D6", "#5856D6",
"#536dfe", "#536dfe",
"#9c27b0", "#9c27b0",
"#AF52DE", "#AF52DE",
"#0096c7", "#0096c7",
"#00C1D4", "#00C1D4",
"#34C759", "#34C759",
"#43a047", "#43a047",
"#7cb342", "#7cb342",
"#c0ca33", "#c0ca33",
"#78DEC7", "#78DEC7",
"#e53935", "#e53935",
"#d81b60", "#d81b60",
"#f4511e", "#f4511e",
"#fb8c00", "#fb8c00",
"#ffb300", "#ffb300",
"#fdd835", "#fdd835",
"#6d4c41", "#6d4c41",
"#546e7a" "#546e7a"
], ],
"otherColor": { "otherColor": {
"info": "#0099ad", "info": "#0099ad",
"success": "#52c41a", "success": "#52c41a",
"warning": "#faad14", "warning": "#faad14",
"error": "#f5222d" "error": "#f5222d"
}, },
"isCustomizeInfoColor": false, "isCustomizeInfoColor": false,
"fixedHeaderAndTab": true, "fixedHeaderAndTab": true,
"showReload": true, "showReload": true,
"header": { "header": {
"inverted": false, "inverted": false,
"height": 56, "height": 56,
"crumb": { "crumb": {
"visible": true, "visible": true,
"showIcon": true "showIcon": true
} }
}, },
"tab": { "tab": {
"visible": true, "visible": true,
"height": 44, "height": 44,
"mode": "chrome", "mode": "chrome",
"modeList": [ "modeList": [
{ {
"value": "chrome", "value": "chrome",
"label": "谷歌风格" "label": "谷歌风格"
}, },
{ {
"value": "button", "value": "button",
"label": "按钮风格" "label": "按钮风格"
} }
], ],
"isCache": true "isCache": true
}, },
"sider": { "sider": {
"inverted": false, "inverted": false,
"width": 220, "width": 220,
"collapsedWidth": 64, "collapsedWidth": 64,
"mixWidth": 80, "mixWidth": 80,
"mixCollapsedWidth": 48, "mixCollapsedWidth": 48,
"mixChildMenuWidth": 200 "mixChildMenuWidth": 200
}, },
"menu": { "menu": {
"horizontalPosition": "flex-start", "horizontalPosition": "flex-start",
"horizontalPositionList": [ "horizontalPositionList": [
{ {
"value": "flex-start", "value": "flex-start",
"label": "居左" "label": "居左"
}, },
{ {
"value": "center", "value": "center",
"label": "居中" "label": "居中"
}, },
{ {
"value": "flex-end", "value": "flex-end",
"label": "居右" "label": "居右"
} }
] ]
}, },
"footer": { "footer": {
"fixed": false, "fixed": false,
"height": 48 "height": 48
}, },
"page": { "page": {
"animate": true, "animate": true,
"animateMode": "fade-slide", "animateMode": "fade-slide",
"animateModeList": [ "animateModeList": [
{ {
"value": "fade-slide", "value": "fade-slide",
"label": "滑动" "label": "滑动"
}, },
{ {
"value": "fade", "value": "fade",
"label": "消退" "label": "消退"
}, },
{ {
"value": "fade-bottom", "value": "fade-bottom",
"label": "底部消退" "label": "底部消退"
}, },
{ {
"value": "fade-scale", "value": "fade-scale",
"label": "缩放消退" "label": "缩放消退"
}, },
{ {
"value": "zoom-fade", "value": "zoom-fade",
"label": "渐变" "label": "渐变"
}, },
{ {
"value": "zoom-out", "value": "zoom-out",
"label": "闪现" "label": "闪现"
} }
] ]
} }
} }

View File

@ -2,7 +2,7 @@ import type { Component } from 'vue';
type ViewComponent = Record<string, () => Promise<Component>>; type ViewComponent = Record<string, () => Promise<Component>>;
const importViews = import.meta.glob('./**/index.vue'); const importViews = import.meta.glob('./**/index.vue') as ViewComponent;
const COMPONENTS_KEY = 'components'; const COMPONENTS_KEY = 'components';
const PREFIX = './'; const PREFIX = './';

View File

@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"module": "ESNext", "module": "ESNext",
"target": "ESNext", "target": "ESNext",
"lib": ["DOM", "ESNext"], "lib": ["DOM", "ESNext"],
@ -12,16 +12,11 @@
"noUnusedLocals": true, "noUnusedLocals": true,
"strictNullChecks": true, "strictNullChecks": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"paths": { "paths": {
"~/*": ["./*"], "~/*": ["./*"],
"@/*": ["./src/*"] "@/*": ["./src/*"]
}, },
"types": [ "types": ["vite/client", "node", "unplugin-icons/types/vue", "naive-ui/volar"]
"vite/client", },
"node", "exclude": ["node_modules", "dist"]
"unplugin-icons/types/vue",
"naive-ui/volar"
]
},
"exclude": ["node_modules", "dist"]
} }