Commit d0029f56 by Jaxon

chron: 项目基本配置

1 parent ebee744f
...@@ -3,12 +3,8 @@ root = true ...@@ -3,12 +3,8 @@ root = true
[*] [*]
charset = utf-8 charset = utf-8
indent_style = space indent_style = tab
indent_size = 2 indent_size = 2
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
build/*.js
src/assets
src/config
public
dist
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', 'eslint:recommended'],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'vue/max-attributes-per-line': [
2,
{
singleline: 10,
multiline: {
max: 1,
allowFirstLine: false
}
}
],
'vue/singleline-html-element-content-newline': 'off',
'vue/multiline-html-element-content-newline': 'off',
'vue/name-property-casing': ['error', 'PascalCase'],
'vue/no-v-html': 'off',
'accessor-pairs': 2,
'arrow-spacing': [
2,
{
before: true,
after: true
}
],
'block-spacing': [2, 'always'],
'brace-style': [
2,
'1tbs',
{
allowSingleLine: true
}
],
camelcase: [
0,
{
properties: 'always'
}
],
'comma-dangle': [2, 'never'],
'comma-spacing': [
2,
{
before: false,
after: true
}
],
'comma-style': [2, 'last'],
'constructor-super': 2,
curly: [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
eqeqeq: ['error', 'always', { null: 'ignore' }],
'generator-star-spacing': [
2,
{
before: true,
after: true
}
],
'handle-callback-err': [2, '^(err|error)$'],
indent: 'off',
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [
2,
{
beforeColon: false,
afterColon: true
}
],
'keyword-spacing': [
2,
{
before: true,
after: true
}
],
'new-cap': [
2,
{
newIsCap: true,
capIsNew: false
}
],
'new-parens': 2,
'no-array-constructor': 2,
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
'no-cond-assign': 2,
'no-const-assign': 2,
'no-control-regex': 0,
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
'no-eval': 2,
'no-ex-assign': 2,
'no-extend-native': 2,
'no-extra-bind': 2,
'no-extra-boolean-cast': 2,
'no-extra-parens': [2, 'functions'],
'no-fallthrough': 2,
'no-floating-decimal': 2,
'no-func-assign': 2,
'no-implied-eval': 2,
'no-inner-declarations': [2, 'functions'],
'no-invalid-regexp': 2,
'no-irregular-whitespace': 2,
'no-iterator': 2,
'no-label-var': 2,
'no-labels': [
2,
{
allowLoop: false,
allowSwitch: false
}
],
'no-lone-blocks': 2,
'no-mixed-spaces-and-tabs': 2,
'no-multi-spaces': 2,
'no-multi-str': 2,
'no-multiple-empty-lines': [
2,
{
max: 1
}
],
'no-native-reassign': 2,
'no-negated-in-lhs': 2,
'no-new-object': 2,
'no-new-require': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
'no-octal': 2,
'no-octal-escape': 2,
'no-path-concat': 2,
'no-proto': 2,
'no-redeclare': 2,
'no-regex-spaces': 2,
'no-return-assign': [2, 'except-parens'],
'no-self-assign': 2,
'no-self-compare': 2,
'no-sequences': 2,
'no-shadow-restricted-names': 2,
'no-spaced-func': 2,
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
'no-trailing-spaces': 2,
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
'no-unmodified-loop-condition': 2,
'no-unneeded-ternary': [
2,
{
defaultAssignment: false
}
],
'no-unreachable': 2,
'no-unsafe-finally': 2,
'no-unused-vars': [
2,
{
vars: 'all',
args: 'none'
}
],
'no-useless-call': 2,
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-with': 2,
'one-var': [
2,
{
initialized: 'never'
}
],
'operator-linebreak': [
2,
'after',
{
overrides: {
'?': 'before',
':': 'before'
}
}
],
'padded-blocks': [2, 'never'],
quotes: [
2,
'single',
{
avoidEscape: true,
allowTemplateLiterals: true
}
],
semi: [2, 'never'],
'semi-spacing': [
2,
{
before: false,
after: true
}
],
'space-before-blocks': [2, 'always'],
'space-before-function-paren': [2, 'never'],
'space-in-parens': [2, 'never'],
'space-infix-ops': 2,
'space-unary-ops': [
2,
{
words: true,
nonwords: false
}
],
'spaced-comment': [
2,
'always',
{
markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}
],
'template-curly-spacing': 'off',
'use-isnan': 2,
'valid-typeof': 2,
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
yoda: [2, 'never'],
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [
2,
'always',
{
objectsInObjects: false
}
],
'array-bracket-spacing': [2, 'never']
}
}
...@@ -12,9 +12,7 @@ yarn-debug.log* ...@@ -12,9 +12,7 @@ yarn-debug.log*
yarn-error.log* yarn-error.log*
# Editor directories and files # Editor directories and files
.trae
.idea .idea
.vscode
*.suo *.suo
*.ntvs* *.ntvs*
*.njsproj *.njsproj
......
{
"changelists": [
{
"name": "Default",
"files": [
"package.json",
"pnpm-lock.yaml",
".gitignore",
".vscode/changelists.json",
".vscode/extensions.json",
".vscode/settings.json",
".vscode/tasks.json",
".vscode/vue2.code-snippets",
".eslintignore",
".eslintrc.js",
"eslint.config.js",
"README.md",
".editorconfig",
"src/App.vue"
]
}
],
"active": "Default"
}
\ No newline at end of file \ No newline at end of file
{
"recommendations": [
"dbaeumer.vscode-eslint",
"stylelint.vscode-stylelint",
"dbaeumer.vscode-eslint",
"Vue.volar"
]
}
\ No newline at end of file \ No newline at end of file
{
"eslint.enable": true,
"eslint.format.enable": true,
"prettier.enable": false,
"i18n-ally.localesPaths": [
"src/locales"
],
"cSpell.words": [
"vuex",
"Cascader",
"glsx"
],
"workbench.tree.indent": 24,
"explorer.compactFolders": false,
"scm.compactFolders": false,
"problems.decorations.enabled": false,
"vetur.validation.template": false,
"vetur.validation.script": false,
"vetur.validation.style": true,
"vetur.ignoreProjectWarning": false,
"vetur.experimental.templateInterpolationService": false,
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"editor.autoIndent": "full",
"editor.codeActionsOnSave": {
// "source.organizeImports": "explicit",
"source.fixAll.eslint": "explicit"
},
"editor.pasteAs.preferences": [
"text.updateImports.jsts",
"text"
],
"eslint.validate": [
"javascript",
"javascriptreact",
"json",
"jsonc",
"vue",
"html",
"mjs",
"markdown",
"yaml",
"toml",
"xml",
"gql",
"graphql",
"astro",
"svelte",
"css",
"less",
"scss",
"pcss",
"postcss"
],
"javascript.preferences.importModuleSpecifier": "non-relative", // 优先使用 @/ 别名路径
"javascript.suggest.autoImports": true, // 确保这个是 true
"vue.updateImportsOnFileMove.enabled": true,
"i18n-ally.sourceLanguage": "zh-chs"
}
\ No newline at end of file \ No newline at end of file
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"problemMatcher": [],
"label": "npm: dev",
"detail": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"Vue 2 Component": {
"prefix": "vue2",
"body": [
"<template>",
" <div class=\"$1\">",
" $0",
" </div>",
"</template>",
"",
"<script>",
"export default {",
" name: '$2',",
" data() {",
" return {",
" $3",
" };",
" },",
" props: {",
" $4",
" },",
" computed: {",
" $5",
" },",
" methods: {",
" $6",
" },",
" mounted() {",
" $7",
" }",
"};",
"</script>",
"",
"<style scoped lang=\"scss\">",
"$8",
"</style>"
],
"description": "Vue 2 单文件组件模板"
},
"Vuex Store Template (Vue2)": {
"prefix": "vuexstore2",
"body": [
"export default {",
" state: {",
" ${1:count}: ${2:0},",
" },",
" getters: {",
" ${3:get${1/(.*)/${1:/capitalize}/}}: state => state.${1},",
" },",
" mutations: {",
" set${1/(.*)/${1:/capitalize}/}(state, payload) {",
" state.${1} = payload;",
" },",
" increment${1/(.*)/${1:/capitalize}/}(state, payload = 1) {",
" state.${1} += payload;",
" }",
" },",
" actions: {",
" ${4:increment${1/(.*)/${1:/capitalize}/}Async}({ commit }, payload) {",
" setTimeout(() => {",
" commit('increment${1/(.*)/${1:/capitalize}/}', payload);",
" }, 1000);",
" }",
" },",
"};"
],
"description": "Vue 2 + Vuex 3 的 store 模板"
}
}
import antfu from "@antfu/eslint-config";
export default antfu({
markdown: true,
vue: true,
css: true,
jsonc: true,
json: true,
ignores: [
// 忽略uni_modules目录
"**/uni_modules/",
"dist",
// unplugin-auto-import 生成的类型文件,每次提交都改变,所以加入这里吧,与 .gitignore 配合使用
"auto-import.d.ts",
"build/",
"tests/",
"node_modules/",
// # node 覆盖率文件
"coverage/",
"**/*-min.js",
"**/*.min.js",
],
stylistic: {
"indent": "tab", // 4个空格
"quotes": "double", // or 'double'
"semi": true,
"array-bracket-spacing": ["error", "always"],
},
rules: {
"vue/no-deprecated-v-on-native-modifier": "off",
"vue/no-deprecated-destroyed-lifecycle": "off",
"vue/no-deprecated-model-definition": "off",
"jsdoc/check-types": "off",
"no-useless-catch": "off",
"vue/no-unused-refs": "warn",
"unused-imports/no-unused-imports": "warn",
"no-unused-vars": "warn",
"style/eol-last": "off",
"no-prototype-builtins": "warn",
"prefer-template": "off",
"no-useless-return": "off",
"vue/no-deprecated-delete-set": "off",
"vue/no-deprecated-dollar-listeners-api": "off",
"vue/require-explicit-emits": "off",
"eqeqeq": "warn",
"vue/eqeqeq": "warn",
"vue/v-on-event-hyphenation": "off",
"style/no-tabs": "off",
"vue/no-deprecated-v-bind-sync": "off",
"vue/no-lone-template": "off",
"vue/no-mutating-props": "off",
"vue/no-deprecated-filter": "off",
"vue/no-v-for-template-key-on-child": "off",
// 强制:Vue 多行 HTML 元素的内容前后必须换行
"vue/multiline-html-element-content-newline": [
"error",
{
ignoreWhenEmpty: false, // 即使元素内容为空,也要求换行(如 <div>\n</div>)
ignores: [], // 无忽略的元素(所有多行元素都生效)
allowEmptyLines: true, // 允许内容前后存在空白行
},
],
// 强制:Vue HTML 标签闭合括号不换行
"vue/html-closing-bracket-newline": [
"error",
{
singleline: "never", // 单行标签:闭合括号不换行(如 <image src="xxx" />)
multiline: "never", // 多行标签:闭合括号不换行(如 <image\n src="xxx"\n/>)
},
],
// 强制:Vue HTML 元素自闭合格式(如 <image /> 而非 <image></image>)
"vue/html-self-closing": [
"error",
{
html: {
void: "any", // 原生空标签(如 <img>)允许任意自闭合格式
normal: "any", // 原生普通标签(如 <div>)允许任意自闭合格式
component: "any", // 自定义组件(如 <MyComponent>)允许任意自闭合格式
},
svg: "any", // SVG 标签允许任意自闭合格式
math: "any", // MathML 标签允许任意自闭合格式
},
],
// 强制:Vue HTML 模板中标签缩进 4 个空格
"vue/html-indent": [
"error",
2,
{
attribute: 1, // 属性相对于标签缩进 1 级(4 个空格)
baseIndent: 1, // 基础缩进 1 级(适配组件嵌套场景)
closeBracket: 0, // 闭合标签与属性对齐(不额外缩进)
alignAttributesVertically: true, // 多行属性时垂直对齐(如所有属性左侧对齐)
ignores: [], // 无忽略的标签
},
],
"vue/attributes-order": ["error", {
order: [
"DEFINITION", // is
"LIST_RENDERING", // v-for
"CONDITIONALS", // v-if v-else-if v-else v-show v-cloak
"RENDER_MODIFIERS", // v-once v-pre
"GLOBAL", // id
"UNIQUE", // ref key
"SLOT", // v-slot slot
"TWO_WAY_BINDING", // v-model
"OTHER_DIRECTIVES", // v-custom-directive
"OTHER_ATTR", // 自定义属性和其他
"EVENTS", // @click @focus
"CONTENT", // v-text v-html
],
alphabetical: true, // 是否在同组内再按字母排序(建议 false,官方默认顺序更好)
}],
// 强制:Vue SFC 中块的顺序(template -> script -> style)
"vue/block-order": [
"error",
{
order: ["template", "script", "style"], // 固定三个核心块的顺序
},
],
// 强制:Vue 元素首属性的换行格式
"vue/first-attribute-linebreak": [
"error",
{
singleline: "beside", // 单行属性:首属性紧跟标签名(不换行)
multiline: "beside", // 多行属性:首属性也紧跟标签名(注:原注释描述与配置冲突,按配置「不换行」,如需换行可改为 "below")
},
],
// 强制:Vue 元素属性每行最多数量限制
"vue/max-attributes-per-line": [
"error",
{
singleline: 2, // 单行元素最多允许 2 个属性(如 <image src="xxx" alt="xxx">)
multiline: 1, // 多行元素每行最多 1 个属性(每个属性单独一行)
},
],
// 关闭:unused-imports 插件的「禁止未使用变量」检测(与 no-unused-vars 功能重叠,同步关闭)
"unused-imports/no-unused-vars": "off",
// 关闭:禁止无限制使用 eslint-disable 注释(允许临时禁用多个规则,按需关闭)
"eslint-comments/no-unlimited-disable": "off",
// 关闭:检查 JSDoc 注释中参数名与实际参数是否一致(无需强制 JSDoc 规范时关闭)
"jsdoc/check-param-names": "off",
// 强制:代码块前必须加空格(如 function fn() { 前加空格,报错级别 error)
"space-before-blocks": "error",
// 关闭:禁止使用 console(开发环境保留 console.log 便于调试,按需关闭)
"no-console": "off",
"style/brace-style": ["error", "1tbs"],
},
formatters: {
/**
* Format CSS, LESS, SCSS files, also the `<style>` blocks in Vue
* By default uses Prettier
*/
css: true,
scss: true,
less: true,
/**
* Format HTML files
* By default uses Prettier
*/
html: true,
},
});
{ {
"name": "supervise-wecom", "name": "supervise-wecom",
"version": "1.0.0", "version": "1.0.0",
"description": "supervise-wecom", "private": true,
"author": "liwk", "description": "supervise-wecom",
"private": true, "author": "liwk",
"scripts": { "scripts": {
"serve": "vue-cli-service serve --open", "serve": "vue-cli-service serve --open",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"stage": "vue-cli-service build --mode staging", "stage": "vue-cli-service build --mode staging",
"lint": "vue-cli-service lint --fix", "lint": "vue-cli-service lint --fix",
"dev": "npm run serve" "dev": "npm run serve"
}, },
"dependencies": { "dependencies": {
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
"glsx-common": "^2.1.0", "glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2", "lib-flexible": "^0.3.2",
"postcss-loader": "^4.3.0", "postcss-loader": "^4.3.0",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"storejs": "^1.1.0", "storejs": "^1.1.0",
"vant": "^2.12.21", "vant": "^2.12.21",
"vconsole": "^3.7.0", "vconsole": "^3.7.0",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vuex": "^3.4.0", "vuex": "^3.4.0",
"webpack-spritesmith": "^1.1.0" "webpack-spritesmith": "^1.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@antfu/eslint-config": "^6.7.3",
"@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0",
"babel-eslint": "^10.1.0", "@vue/cli-service": "~4.5.0",
"babel-plugin-import": "^1.13.0", "babel-eslint": "^10.1.0",
"babel-plugin-transform-remove-console": "^6.9.4", "babel-plugin-import": "^1.13.0",
"eslint": "^6.7.2", "babel-plugin-transform-remove-console": "^6.9.4",
"eslint-plugin-vue": "^6.2.2", "eslint": "^9.39.2",
"postcss-px-to-viewport": "^1.1.1", "eslint-plugin-format": "^1.2.0",
"postcss-pxtorem": "^5.1.1", "postcss-px-to-viewport": "^1.1.1",
"sass": "^1.99.0", "postcss-pxtorem": "^5.1.1",
"sass-loader": "^8.0.2", "sass": "^1.99.0",
"script-ext-html-webpack-plugin": "^2.1.4", "sass-loader": "^8.0.2",
"vue-loader": "^15.9.8", "script-ext-html-webpack-plugin": "^2.1.4",
"vue-template-compiler": "^2.6.11", "vue-loader": "^15.9.8",
"webpack-bundle-analyzer": "^3.8.0" "vue-template-compiler": "^2.6.11",
} "webpack-bundle-analyzer": "^3.8.0"
},
"volta": {
"node": "20.20.2"
}
} }
This diff could not be displayed because it is too large.
...@@ -11,42 +11,44 @@ ...@@ -11,42 +11,44 @@
</transition> </transition>
<!-- 底部全局 TabBar --> <!-- 底部全局 TabBar -->
<tab-bar v-if="$route.meta.showTabBar"></tab-bar> <TabBar v-if="$route.meta.showTabBar"></TabBar>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
import TabBar from '@/components/tabBar/index.vue' import TabBar from "@/components/tabBar/index.vue";
export default { export default {
name: 'App', name: "App",
components: { components: {
TabBar TabBar,
}, },
data() { data() {
return { return {
showWindow: false showWindow: false,
} };
}, },
watch: { computed: {
watchFlag: { watchFlag() {
immediate: true, return this.$store.state.app.showWindow;
handler(newval) { },
console.log(newval, '===') },
this.showWindow = newval watch: {
this.hideLoading() watchFlag: {
} immediate: true,
} handler(newval) {
}, console.log(newval, "===");
computed: { this.showWindow = newval;
watchFlag() { this.hideLoading();
return this.$store.state.app.showWindow },
} },
}, },
mounted() {}, mounted() {},
methods: {} methods: {},
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!