Skip to content

Commit

Permalink
基础更新
Browse files Browse the repository at this point in the history
  • Loading branch information
lvzhenbo committed Oct 20, 2024
1 parent 61bcbac commit 0535323
Show file tree
Hide file tree
Showing 9 changed files with 931 additions and 930 deletions.
7 changes: 6 additions & 1 deletion .eslintrc-auto-import.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
"onWatcherCleanup": true,
"useId": true,
"useModel": true,
"useTemplateRef": true
"useTemplateRef": true,
"DirectiveBinding": true,
"MaybeRef": true,
"MaybeRefOrGetter": true,
"useOsTheme": true,
"useClipboard": true
}
}
42 changes: 0 additions & 42 deletions .eslintrc.cjs

This file was deleted.

4 changes: 3 additions & 1 deletion auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ declare global {
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useDialog: typeof import('naive-ui')['useDialog']
Expand All @@ -60,6 +61,7 @@ declare global {
const useMessage: typeof import('naive-ui')['useMessage']
const useModel: typeof import('vue')['useModel']
const useNotification: typeof import('naive-ui')['useNotification']
const useOsTheme: typeof import('naive-ui')['useOsTheme']
const useSlots: typeof import('vue')['useSlots']
const useTemplateRef: typeof import('vue')['useTemplateRef']
const watch: typeof import('vue')['watch']
Expand All @@ -70,6 +72,6 @@ declare global {
// for type re-export
declare global {
// @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
import('vue')
}
67 changes: 67 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { defineFlatConfig } from 'eslint-define-config';
import js from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import vueTsEslintConfig from '@vue/eslint-config-typescript';
import prettierConfig from '@vue/eslint-config-prettier';
import parserVue from 'vue-eslint-parser';
import AutoImport from './.eslintrc-auto-import.json' with { type: 'json' };

export default defineFlatConfig([
...pluginVue.configs['flat/recommended'],
js.configs.recommended,
...vueTsEslintConfig({
supportedScriptLangs: {
ts: true,
tsx: true,
},
}),
{
name: 'app/vue-files',
files: ['**/*.vue'],
languageOptions: {
parser: parserVue,
parserOptions: {
ecmaVersion: 'latest',
},
},
},
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
languageOptions: {
globals: {
...AutoImport.globals,
},
},
rules: {
// 允许被禁止的类型 https://typescript-eslint.io/rules/ban-types/
'@typescript-eslint/ban-types': 'off',
// 允许any类型 https://typescript-eslint.io/rules/no-explicit-any/
'@typescript-eslint/no-explicit-any': 'off',
// 允许任何TS指令注释 https://typescript-eslint.io/rules/ban-ts-comment
'@typescript-eslint/ban-ts-comment': 'off',
// 允许空函数 https://typescript-eslint.io/rules/no-empty-function/
'@typescript-eslint/no-empty-function': 'off',
// 关闭强制多词组件名 https://eslint.vuejs.org/rules/multi-word-component-names.html
'vue/multi-word-component-names': 'off',
// 强制执行自我关闭风格 https://eslint.vuejs.org/rules/html-self-closing.html
'vue/html-self-closing': [
'error',
{
html: {
void: 'always',
normal: 'never',
component: 'always',
},
svg: 'always',
math: 'always',
},
],
},
},
{
name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**'],
},
prettierConfig,
]);
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,33 @@
"@vicons/fluent": "^0.12.0",
"@vueuse/core": "^11.1.0",
"highlight.js": "^11.10.0",
"naive-ui": "^2.39.0",
"vue": "^3.5.8"
"naive-ui": "^2.40.1",
"vue": "^3.5.12"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.4",
"@eslint/js": "^9.13.0",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^20.16.7",
"@types/node": "^20.16.13",
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@vue/eslint-config-prettier": "^10.0.0",
"@vue/eslint-config-typescript": "^14.1.1",
"@vue/tsconfig": "^0.5.1",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.1",
"eslint-plugin-vue": "^9.28.0",
"eslint": "^9.13.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-vue": "^9.29.0",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.13",
"typescript": "~5.6.2",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.3",
"unplugin-auto-import": "^0.18.3",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.8",
"vite-plugin-vue-devtools": "^7.4.6",
"vite": "^5.4.9",
"vite-plugin-vue-devtools": "^7.5.2",
"vue-eslint-parser": "^9.4.3",
"vue-tsc": "^2.1.6"
},
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
"packageManager": "pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca"
}
Loading

0 comments on commit 0535323

Please sign in to comment.