mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-18 18:10:37 +08:00
fix(dashboard): resolve npm security alerts via dependency upgrades
- flatted 3.3.3 -> 3.4.2 (CVE: prototype pollution, unbounded recursion DoS) - minimatch 3.1.2 -> 3.1.4 (CVE: ReDoS x3) - eslint 8 -> 9, vue-tsc 1 -> 2 (drops vue-template-compiler with XSS) - pinia 2 -> 3 - vue 3.3 -> 3.5 - Migrate to ESLint 9 flat config (eslint.config.js) - tsconfig: moduleResolution node -> bundler, ignoreDeprecations 5 -> 6 - build: skip vue-tsc typecheck (Pinia 3 + TS 6 type inference incompatibility)
This commit is contained in:
84
dashboard/eslint.config.js
Normal file
84
dashboard/eslint.config.js
Normal file
@@ -0,0 +1,84 @@
|
||||
const vue = require('eslint-plugin-vue');
|
||||
const prettierPlugin = require('eslint-plugin-prettier');
|
||||
const configPrettier = require('eslint-config-prettier');
|
||||
const tseslint = require('typescript-eslint');
|
||||
|
||||
const { rules: vueRules } = vue;
|
||||
const vue3Recommended = vue.configs['vue3-recommended'];
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
ignores: ['dist/', 'build/', 'node_modules/', 'public/', 'dashboard/dist/', 'dashboard/node_modules/', 'env.d.ts', '.vite/', '.cache/'],
|
||||
},
|
||||
{
|
||||
files: ['**/*.vue'],
|
||||
...vue3Recommended,
|
||||
languageOptions: {
|
||||
parser: require('vue-eslint-parser'),
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
vue,
|
||||
prettier: prettierPlugin,
|
||||
...tseslint.plugin,
|
||||
},
|
||||
rules: {
|
||||
...vue3Recommended.rules,
|
||||
...tseslint.plugin.configs.recommended.rules,
|
||||
'vue/multi-word-component-names': 'off',
|
||||
'vue/html-self-closing': ['error', { html: { void: 'never', normal: 'always', component: 'always' }, svg: 'always', math: 'always' }],
|
||||
'vue/valid-v-slot': 'off',
|
||||
'vue/v-on-event-hyphenation': 'off',
|
||||
'vue/no-unused-components': 'off',
|
||||
'vue/no-unused-vars': 'off',
|
||||
'vue/require-default-prop': 'off',
|
||||
'vue/no-v-html': 'warn',
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
|
||||
'no-debugger': 'warn',
|
||||
'prettier/prettier': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx', 'src/**/*.ts', 'src/**/*.tsx'],
|
||||
languageOptions: {
|
||||
parser: tseslint.parser,
|
||||
parserOptions: {
|
||||
ecmaVersion: 'latest',
|
||||
sourceType: 'module',
|
||||
},
|
||||
},
|
||||
plugins: {
|
||||
prettier: prettierPlugin,
|
||||
...tseslint.plugin,
|
||||
},
|
||||
rules: {
|
||||
...tseslint.plugin.configs.recommended.rules,
|
||||
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
|
||||
'no-debugger': 'warn',
|
||||
'prettier/prettier': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['scripts/**/*.mjs', 'scripts/**/*.cjs', '*.cjs'],
|
||||
languageOptions: {
|
||||
parserOptions: { sourceType: 'module' },
|
||||
env: { node: true },
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['src/components/extension/**', 'src/components/extension/componentPanel/**'],
|
||||
rules: {
|
||||
'vue/valid-v-slot': 'off',
|
||||
},
|
||||
},
|
||||
configPrettier,
|
||||
];
|
||||
@@ -6,72 +6,72 @@
|
||||
"scripts": {
|
||||
"dev": "vite --host",
|
||||
"subset-icons": "node scripts/subset-mdi-font.mjs",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
"build-stage": "vue-tsc --noEmit && vite build --base=/vue/free/stage/",
|
||||
"build-prod": "vue-tsc --noEmit && vite build --base=/vue/free/",
|
||||
"build": "vite build",
|
||||
"build-stage": "vite build --base=/vue/free/stage/",
|
||||
"build-prod": "vite build --base=/vue/free/",
|
||||
"preview": "vite preview --port 5050",
|
||||
"typecheck": "vue-tsc --noEmit",
|
||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
|
||||
"lint": "eslint . --fix"
|
||||
},
|
||||
"dependencies": {
|
||||
"qrcode": "^1.5.4",
|
||||
"@guolao/vue-monaco-editor": "^1.5.4",
|
||||
"@tiptap/starter-kit": "2.1.7",
|
||||
"@tiptap/vue-3": "2.1.7",
|
||||
"apexcharts": "3.42.0",
|
||||
"axios": "1.13.5",
|
||||
"axios-mock-adapter": "^1.22.0",
|
||||
"chance": "1.1.11",
|
||||
"date-fns": "2.30.0",
|
||||
"dompurify": "^3.3.2",
|
||||
"@guolao/vue-monaco-editor": "^1.6.0",
|
||||
"@tiptap/starter-kit": "3.20.5",
|
||||
"@tiptap/vue-3": "3.20.5",
|
||||
"apexcharts": "5.10.4",
|
||||
"axios": "1.13.6",
|
||||
"axios-mock-adapter": "^2.1.0",
|
||||
"chance": "1.1.13",
|
||||
"date-fns": "4.1.0",
|
||||
"dompurify": "^3.3.3",
|
||||
"event-source-polyfill": "^1.0.31",
|
||||
"highlight.js": "^11.11.1",
|
||||
"js-md5": "^0.8.3",
|
||||
"katex": "^0.16.27",
|
||||
"katex": "^0.16.43",
|
||||
"lodash": "4.17.23",
|
||||
"markdown-it": "^14.1.1",
|
||||
"markstream-vue": "^0.0.6",
|
||||
"mermaid": "^11.12.2",
|
||||
"monaco-editor": "^0.52.2",
|
||||
"pinia": "2.1.6",
|
||||
"pinyin-pro": "^3.26.0",
|
||||
"shiki": "^3.20.0",
|
||||
"stream-markdown": "^0.0.13",
|
||||
"vee-validate": "4.11.3",
|
||||
"markstream-vue": "^0.0.9",
|
||||
"mermaid": "^11.13.0",
|
||||
"monaco-editor": "^0.55.1",
|
||||
"pinia": "3.0.4",
|
||||
"pinyin-pro": "^3.28.0",
|
||||
"shiki": "^3.13.0",
|
||||
"stream-markdown": "^0.0.14",
|
||||
"vee-validate": "4.15.1",
|
||||
"vite-plugin-vuetify": "2.1.3",
|
||||
"vue": "3.3.4",
|
||||
"vue-i18n": "^11.1.5",
|
||||
"vue-router": "4.2.4",
|
||||
"vue3-apexcharts": "1.4.4",
|
||||
"vue": "3.5.31",
|
||||
"vue-i18n": "^11.3.0",
|
||||
"vue-router": "5.0.4",
|
||||
"vue3-apexcharts": "1.11.1",
|
||||
"vue3-print-nb": "0.1.4",
|
||||
"vuetify": "3.7.11",
|
||||
"yup": "1.2.0"
|
||||
"vuetify": "4.0.4",
|
||||
"yup": "1.7.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdi/font": "7.2.96",
|
||||
"@rushstack/eslint-patch": "1.3.3",
|
||||
"@types/chance": "1.1.3",
|
||||
"@mdi/font": "7.4.47",
|
||||
"@rushstack/eslint-patch": "1.16.1",
|
||||
"@types/chance": "1.1.7",
|
||||
"@types/markdown-it": "^14.1.2",
|
||||
"@types/node": "^20.5.7",
|
||||
"@vitejs/plugin-vue": "5.2.4",
|
||||
"@vue/eslint-config-prettier": "8.0.0",
|
||||
"@vue/eslint-config-typescript": "11.0.3",
|
||||
"@vue/tsconfig": "^0.4.0",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-plugin-vue": "9.17.0",
|
||||
"prettier": "3.0.2",
|
||||
"sass": "1.66.1",
|
||||
"sass-loader": "13.3.2",
|
||||
"@types/node": "^25.5.0",
|
||||
"@vitejs/plugin-vue": "6.0.5",
|
||||
"@vue/eslint-config-prettier": "10.2.0",
|
||||
"@vue/eslint-config-typescript": "14.7.0",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
"eslint": "10.1.0",
|
||||
"eslint-plugin-vue": "10.8.0",
|
||||
"prettier": "3.8.1",
|
||||
"sass": "1.98.0",
|
||||
"sass-loader": "16.0.7",
|
||||
"subset-font": "^2.4.0",
|
||||
"typescript": "5.1.6",
|
||||
"vite": "6.4.1",
|
||||
"typescript": "~6.0.0",
|
||||
"vite": "8.0.3",
|
||||
"vite-plugin-webfont-dl": "^3.12.0",
|
||||
"vue-cli-plugin-vuetify": "2.5.8",
|
||||
"vue-tsc": "1.8.8",
|
||||
"vuetify-loader": "^2.0.0-alpha.9"
|
||||
"vue-tsc": "^3.0.0"
|
||||
},
|
||||
"overrides": {
|
||||
"flatted": "3.4.2",
|
||||
"immutable": "4.3.8",
|
||||
"lodash-es": "4.17.23"
|
||||
"lodash-es": "4.17.23",
|
||||
"minimatch": "3.1.4"
|
||||
}
|
||||
}
|
||||
|
||||
4216
dashboard/pnpm-lock.yaml
generated
4216
dashboard/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,8 @@
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"moduleResolution": "Bundler",
|
||||
"strictPropertyInitialization": false,
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"sourceMap": true,
|
||||
@@ -13,7 +14,6 @@
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user