mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-04-30 22:29:01 +08:00
chore: eslint 替换为 @antfu/eslint-config,集成 lint-staged 和 simple-git-hooks
This commit is contained in:
parent
004ef366f2
commit
98f9d5893a
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
@ -1,4 +0,0 @@
|
|||||||
node_modules
|
|
||||||
dist
|
|
||||||
public
|
|
||||||
package.json
|
|
@ -1,3 +0,0 @@
|
|||||||
/node_modules/**
|
|
||||||
/dist/*
|
|
||||||
/public/*
|
|
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"printWidth": 100,
|
|
||||||
"singleQuote": true,
|
|
||||||
"semi": false,
|
|
||||||
"endOfLine": "auto",
|
|
||||||
"htmlWhitespaceSensitivity": "ignore"
|
|
||||||
}
|
|
44
.vscode/settings.json
vendored
44
.vscode/settings.json
vendored
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"files.eol": "\n",
|
// Enable the ESlint flat config support
|
||||||
"files.associations": {
|
// (remove this if your ESLint extension above v3.0.5)
|
||||||
"*.env.*": "dotenv",
|
"eslint.experimental.useFlatConfig": true,
|
||||||
"*.svg": "html",
|
|
||||||
"*.css": "scss"
|
"prettier.enable": false,
|
||||||
|
"editor.formatOnSave": false,
|
||||||
|
|
||||||
|
// Auto fix
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": "explicit",
|
||||||
|
"source.organizeImports": "never"
|
||||||
},
|
},
|
||||||
|
|
||||||
"editor.formatOnSave": false,
|
// Enable eslint for all supported languages
|
||||||
"[html][css][less][scss][sass][yaml][yml][jsonc][json]": {
|
"eslint.validate": [
|
||||||
"editor.formatOnSave": true,
|
"javascript",
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"javascriptreact",
|
||||||
},
|
"typescript",
|
||||||
"[markdown]": {
|
"typescriptreact",
|
||||||
"editor.formatOnSave": true,
|
"vue",
|
||||||
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
|
"html",
|
||||||
},
|
"markdown",
|
||||||
"editor.codeActionsOnSave": {
|
"json",
|
||||||
"source.fixAll.eslint": "explicit"
|
"jsonc"
|
||||||
},
|
]
|
||||||
"eslint.validate": ["javascript", "typescript", "javascriptreact", "typescriptreact", "vue"],
|
|
||||||
"eslint.options": {
|
|
||||||
"overrideConfigFile": "package.json"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
28
eslint.config.js
Normal file
28
eslint.config.js
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import antfu from '@antfu/eslint-config'
|
||||||
|
|
||||||
|
export default antfu({
|
||||||
|
unocss: true,
|
||||||
|
formatters: true,
|
||||||
|
stylistic: true,
|
||||||
|
rules: {
|
||||||
|
'n/prefer-global/process': 'off',
|
||||||
|
'no-undef': 'error',
|
||||||
|
'no-fallthrough': 'off',
|
||||||
|
'vue/block-order': 'off',
|
||||||
|
},
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
h: 'readonly',
|
||||||
|
provide: 'readonly',
|
||||||
|
inject: 'readonly',
|
||||||
|
markRaw: 'readonly',
|
||||||
|
defineAsyncComponent: 'readonly',
|
||||||
|
nextTick: 'readonly',
|
||||||
|
useRoute: 'readonly',
|
||||||
|
useRouter: 'readonly',
|
||||||
|
Message: 'readonly',
|
||||||
|
Modal: 'readonly',
|
||||||
|
NProgress: 'readonly',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
59
package.json
59
package.json
@ -1,18 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-naive-admin",
|
"name": "vue-naive-admin",
|
||||||
"private": true,
|
|
||||||
"version": "2.0.0",
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"lint:fix": "eslint --fix --ext .js,.vue ."
|
"lint:fix": "eslint --fix",
|
||||||
|
"postinstall": "npx simple-git-hooks",
|
||||||
|
"up": "taze major -I"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@arco-design/color": "^0.4.0",
|
"@arco-design/color": "^0.4.0",
|
||||||
"@vueuse/core": "^10.9.0",
|
"@vueuse/core": "^10.10.0",
|
||||||
"axios": "^1.6.8",
|
"axios": "^1.7.2",
|
||||||
"dayjs": "^1.11.11",
|
"dayjs": "^1.11.11",
|
||||||
"echarts": "^5.5.0",
|
"echarts": "^5.5.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
@ -20,39 +22,40 @@
|
|||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"pinia-plugin-persistedstate": "^3.2.1",
|
"pinia-plugin-persistedstate": "^3.2.1",
|
||||||
"vue": "^3.4.27",
|
"vue": "^3.4.27",
|
||||||
"vue-echarts": "^6.7.2",
|
"vue-echarts": "^6.7.3",
|
||||||
"vue-router": "^4.3.2",
|
"vue-router": "^4.3.2",
|
||||||
"xlsx": "^0.18.5"
|
"xlsx": "^0.18.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify/json": "^2.2.210",
|
"@antfu/eslint-config": "^2.20.0",
|
||||||
"@iconify/utils": "^2.1.23",
|
"@iconify/json": "^2.2.216",
|
||||||
"@unocss/eslint-config": "^0.58.9",
|
"@iconify/utils": "^2.1.24",
|
||||||
"@unocss/preset-rem-to-px": "^0.59.4",
|
"@unocss/eslint-config": "^0.60.4",
|
||||||
"@vitejs/plugin-vue": "^5.0.4",
|
"@unocss/eslint-plugin": "^0.60.4",
|
||||||
|
"@unocss/preset-rem-to-px": "^0.60.4",
|
||||||
|
"@vitejs/plugin-vue": "^5.0.5",
|
||||||
"@zclzone/eslint-config": "^0.0.5",
|
"@zclzone/eslint-config": "^0.0.5",
|
||||||
|
"eslint": "^9.4.0",
|
||||||
|
"eslint-plugin-format": "^0.1.1",
|
||||||
"esno": "^4.7.0",
|
"esno": "^4.7.0",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
"glob": "^10.3.15",
|
"glob": "^10.4.1",
|
||||||
|
"lint-staged": "^15.2.5",
|
||||||
"rollup-plugin-visualizer": "^5.12.0",
|
"rollup-plugin-visualizer": "^5.12.0",
|
||||||
"sass": "^1.77.1",
|
"sass": "^1.77.4",
|
||||||
"unocss": "^0.59.4",
|
"simple-git-hooks": "^2.11.1",
|
||||||
|
"taze": "^0.13.8",
|
||||||
|
"unocss": "^0.60.4",
|
||||||
"unplugin-auto-import": "^0.17.6",
|
"unplugin-auto-import": "^0.17.6",
|
||||||
"unplugin-vue-components": "^0.26.0",
|
"unplugin-vue-components": "^0.27.0",
|
||||||
"vite": "^5.2.11",
|
"vite": "^5.2.12",
|
||||||
"vite-plugin-router-warn": "^1.0.0",
|
"vite-plugin-router-warn": "^1.0.0",
|
||||||
"vite-plugin-vue-devtools": "^7.2.0"
|
"vite-plugin-vue-devtools": "^7.2.1"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"simple-git-hooks": {
|
||||||
"extends": [
|
"pre-commit": "pnpm lint-staged"
|
||||||
"@zclzone",
|
},
|
||||||
"@unocss",
|
"lint-staged": {
|
||||||
".eslint-global-variables.json"
|
"*": "eslint --fix"
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaFeatures": {
|
|
||||||
"jsx": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
7786
pnpm-lock.yaml
generated
7786
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user