修改了.eslintrc.cjs 文件,将vue文件的配置做为override的一项。
This commit is contained in:
		@@ -15,6 +15,41 @@ module.exports = {
 | 
				
			|||||||
        browser: true,
 | 
					        browser: true,
 | 
				
			||||||
        es2021: true,
 | 
					        es2021: true,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					    parser:"espree",
 | 
				
			||||||
 | 
					    extends:["eslint:recommended",],
 | 
				
			||||||
 | 
					    rules:{
 | 
				
			||||||
 | 
					        indent: ["warn", 4,],
 | 
				
			||||||
 | 
					        // "space-in-parens": ["error", "always", { exceptions: ["empty",], },],
 | 
				
			||||||
 | 
					        "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
				
			||||||
 | 
					        "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
				
			||||||
 | 
					        "no-unused-vars": "warn",
 | 
				
			||||||
 | 
					        semi: ["error", "always",], // 控制行尾部分号
 | 
				
			||||||
 | 
					        quotes: ["error", "double",],
 | 
				
			||||||
 | 
					        "comma-dangle": ["error", {
 | 
				
			||||||
 | 
					            arrays: "always",
 | 
				
			||||||
 | 
					            objects: "always",
 | 
				
			||||||
 | 
					            imports: "never",
 | 
				
			||||||
 | 
					            exports: "never",
 | 
				
			||||||
 | 
					            functions: "never",
 | 
				
			||||||
 | 
					        },], // 数组和对象键值对最后一个逗号
 | 
				
			||||||
 | 
					        "comma-style": ["error", "last",], //  逗号在行位
 | 
				
			||||||
 | 
					        "array-bracket-spacing": ["error", "never",],
 | 
				
			||||||
 | 
					        "no-undef-init": "error",
 | 
				
			||||||
 | 
					        "no-invalid-this": "error",
 | 
				
			||||||
 | 
					        "no-use-before-define": "error",
 | 
				
			||||||
 | 
					        "no-shadow-restricted-names": "error", //  禁止对一些关键字或者保留字进行赋值操作,比如NaN、Infinity、undefined、eval、arguments等
 | 
				
			||||||
 | 
					        "comma-spacing": ["error", { before: false, after: true, },],
 | 
				
			||||||
 | 
					        "brace-style": ["error", "allman", { allowSingleLine: true, },],
 | 
				
			||||||
 | 
					        "prefer-const": "warn",
 | 
				
			||||||
 | 
					        "space-before-function-paren": ["error", {
 | 
				
			||||||
 | 
					            anonymous: "always",
 | 
				
			||||||
 | 
					            named: "never",
 | 
				
			||||||
 | 
					            asyncArrow: "always",
 | 
				
			||||||
 | 
					        },],
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    overrides: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            files: ["*.vue",],
 | 
				
			||||||
            parser: "vue-eslint-parser",
 | 
					            parser: "vue-eslint-parser",
 | 
				
			||||||
            parserOptions: {
 | 
					            parserOptions: {
 | 
				
			||||||
                ecmaVersion: 2021,
 | 
					                ecmaVersion: 2021,
 | 
				
			||||||
@@ -84,7 +119,7 @@ module.exports = {
 | 
				
			|||||||
                "@typescript-eslint/quotes": ["error", "double",],
 | 
					                "@typescript-eslint/quotes": ["error", "double",],
 | 
				
			||||||
                "@typescript-eslint/space-before-function-paren": "off",
 | 
					                "@typescript-eslint/space-before-function-paren": "off",
 | 
				
			||||||
            },
 | 
					            },
 | 
				
			||||||
    overrides: [
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            files: ["*.ts",],
 | 
					            files: ["*.ts",],
 | 
				
			||||||
            parser: "@typescript-eslint/parser",
 | 
					            parser: "@typescript-eslint/parser",
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										146
									
								
								code/web/task_schedule/.eslintrc_bak.cjs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										146
									
								
								code/web/task_schedule/.eslintrc_bak.cjs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,146 @@
 | 
				
			|||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * @Author: Kane
 | 
				
			||||||
 | 
					 * @Date: 2023-03-20 15:44:00
 | 
				
			||||||
 | 
					 * @LastEditors: Kane
 | 
				
			||||||
 | 
					 * @FilePath: /task_schedule/.eslintrc_bak.cjs
 | 
				
			||||||
 | 
					 * @Description: 
 | 
				
			||||||
 | 
					 * 
 | 
				
			||||||
 | 
					 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * @Author: Kane
 | 
				
			||||||
 | 
					 * @Date: 2023-03-14 09:19:21
 | 
				
			||||||
 | 
					 * @LastEditors: Kane
 | 
				
			||||||
 | 
					 * @FilePath: /task_schedule/.eslintrc.cjs
 | 
				
			||||||
 | 
					 * @Description: eslint 配置文件
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * Copyright (c) ${2022} by Kane, All Rights Reserved.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module.exports = {
 | 
				
			||||||
 | 
					    root: true,
 | 
				
			||||||
 | 
					    env: { //  需要在env中指定运行的环境,这些环境其实就是一组预定义的全局变量,让 ESLint 知道当前环境存在这些全局变量
 | 
				
			||||||
 | 
					        node: true,
 | 
				
			||||||
 | 
					        browser: true,
 | 
				
			||||||
 | 
					        es2021: true,
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    parser: "vue-eslint-parser",
 | 
				
			||||||
 | 
					    parserOptions: {
 | 
				
			||||||
 | 
					        ecmaVersion: 2021,
 | 
				
			||||||
 | 
					        sourceType: "module",
 | 
				
			||||||
 | 
					        parser: { // <script>标签中的lang属性配置不同的parser
 | 
				
			||||||
 | 
					            ts: "@typescript-eslint/parser",
 | 
				
			||||||
 | 
					            js: "espree",
 | 
				
			||||||
 | 
					            "<template>": "espree",
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    plugins: ["eslint-plugin-vue",],
 | 
				
			||||||
 | 
					    extends: [
 | 
				
			||||||
 | 
					        "plugin:vue/vue3-essential",
 | 
				
			||||||
 | 
					        "plugin:vue/recommended",
 | 
				
			||||||
 | 
					        "eslint:recommended",
 | 
				
			||||||
 | 
					        "standard-with-typescript",
 | 
				
			||||||
 | 
					        "plugin:@typescript-eslint/eslint-recommended",
 | 
				
			||||||
 | 
					        "plugin:@typescript-eslint/recommended",
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					    rules: {
 | 
				
			||||||
 | 
					        indent: ["warn", 4,],
 | 
				
			||||||
 | 
					        // "space-in-parens": ["error", "always", { exceptions: ["empty",], },],
 | 
				
			||||||
 | 
					        "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
				
			||||||
 | 
					        "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
				
			||||||
 | 
					        "no-unused-vars": "warn",
 | 
				
			||||||
 | 
					        semi: ["error", "always",], // 控制行尾部分号
 | 
				
			||||||
 | 
					        quotes: ["error", "double",],
 | 
				
			||||||
 | 
					        "comma-dangle": ["error", {
 | 
				
			||||||
 | 
					            arrays: "always",
 | 
				
			||||||
 | 
					            objects: "always",
 | 
				
			||||||
 | 
					            imports: "never",
 | 
				
			||||||
 | 
					            exports: "never",
 | 
				
			||||||
 | 
					            functions: "never",
 | 
				
			||||||
 | 
					        },], // 数组和对象键值对最后一个逗号
 | 
				
			||||||
 | 
					        "comma-style": ["error", "last",], //  逗号在行位
 | 
				
			||||||
 | 
					        "array-bracket-spacing": ["error", "never",],
 | 
				
			||||||
 | 
					        "no-undef-init": "error",
 | 
				
			||||||
 | 
					        "no-invalid-this": "error",
 | 
				
			||||||
 | 
					        "no-use-before-define": "error",
 | 
				
			||||||
 | 
					        "no-shadow-restricted-names": "error", //  禁止对一些关键字或者保留字进行赋值操作,比如NaN、Infinity、undefined、eval、arguments等
 | 
				
			||||||
 | 
					        "comma-spacing": ["error", { before: false, after: true, },],
 | 
				
			||||||
 | 
					        "brace-style": ["error", "allman", { allowSingleLine: true, },],
 | 
				
			||||||
 | 
					        "prefer-const": "warn",
 | 
				
			||||||
 | 
					        "space-before-function-paren": ["error", {
 | 
				
			||||||
 | 
					            anonymous: "always",
 | 
				
			||||||
 | 
					            named: "never",
 | 
				
			||||||
 | 
					            asyncArrow: "always",
 | 
				
			||||||
 | 
					        },],
 | 
				
			||||||
 | 
					        // vue
 | 
				
			||||||
 | 
					        "vue/html-indent": ["error", 4,],
 | 
				
			||||||
 | 
					        // typescript
 | 
				
			||||||
 | 
					        "@typescript-eslint/indent": ["warn", 4,],
 | 
				
			||||||
 | 
					        "@typescript-eslint/no-extra-semi": "off",
 | 
				
			||||||
 | 
					        "@typescript-eslint/no-inferrable-types": "off",
 | 
				
			||||||
 | 
					        "@typescript-eslint/no-unused-vars": "warn",
 | 
				
			||||||
 | 
					        "@typescript-eslint/ban-ts-comment": "warn",
 | 
				
			||||||
 | 
					        "@typescript-eslint/member-delimiter-style": "off",
 | 
				
			||||||
 | 
					        "@typescript-eslint/semi": ["error", "always",], //  控制行尾部分号
 | 
				
			||||||
 | 
					        "@typescript-eslint/brace-style": ["error", "allman", { allowSingleLine: true, },],
 | 
				
			||||||
 | 
					        "@typescript-eslint/comma-dangle": ["error", {
 | 
				
			||||||
 | 
					            arrays: "always",
 | 
				
			||||||
 | 
					            objects: "always",
 | 
				
			||||||
 | 
					            imports: "never",
 | 
				
			||||||
 | 
					            exports: "never",
 | 
				
			||||||
 | 
					            functions: "never",
 | 
				
			||||||
 | 
					        },], // 数组和对象键值对最后一个逗号
 | 
				
			||||||
 | 
					        "@typescript-eslint/quotes": ["error", "double",],
 | 
				
			||||||
 | 
					        "@typescript-eslint/space-before-function-paren": "off",
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    overrides: [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            files: ["*.ts",],
 | 
				
			||||||
 | 
					            parser: "@typescript-eslint/parser",
 | 
				
			||||||
 | 
					            parserOptions: {
 | 
				
			||||||
 | 
					                project: "./tsconfig.json",
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					            plugins: ["@typescript-eslint",],
 | 
				
			||||||
 | 
					            extends: [
 | 
				
			||||||
 | 
					                "standard-with-typescript",
 | 
				
			||||||
 | 
					                "eslint:recommended",
 | 
				
			||||||
 | 
					                "plugin:@typescript-eslint/eslint-recommended",
 | 
				
			||||||
 | 
					                "plugin:@typescript-eslint/recommended",
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            rules: {
 | 
				
			||||||
 | 
					                "space-in-parens": ["error", "always", { exceptions: ["empty",], },],
 | 
				
			||||||
 | 
					                "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
				
			||||||
 | 
					                "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
 | 
				
			||||||
 | 
					                "@typescript-eslint/indent": ["error", 4,],
 | 
				
			||||||
 | 
					                "@typescript-eslint/no-extra-semi": "off",
 | 
				
			||||||
 | 
					                "@typescript-eslint/no-inferrable-types": "off",
 | 
				
			||||||
 | 
					                "@typescript-eslint/no-unused-vars": "warn",
 | 
				
			||||||
 | 
					                "@typescript-eslint/ban-ts-comment": "warn",
 | 
				
			||||||
 | 
					                "@typescript-eslint/member-delimiter-style": "off",
 | 
				
			||||||
 | 
					                "@typescript-eslint/semi": ["error", "always",], // 控制行尾部分号
 | 
				
			||||||
 | 
					                "@typescript-eslint/brace-style": ["error", "allman", { allowSingleLine: true, },],
 | 
				
			||||||
 | 
					                "@typescript-eslint/comma-dangle": ["error", {
 | 
				
			||||||
 | 
					                    arrays: "always",
 | 
				
			||||||
 | 
					                    objects: "always",
 | 
				
			||||||
 | 
					                    imports: "never",
 | 
				
			||||||
 | 
					                    exports: "never",
 | 
				
			||||||
 | 
					                    functions: "never",
 | 
				
			||||||
 | 
					                },], // 数组和对象键值对最后一个逗号
 | 
				
			||||||
 | 
					                "@typescript-eslint/quotes": ["error", "double",],
 | 
				
			||||||
 | 
					                "@typescript-eslint/space-before-function-paren": "off",
 | 
				
			||||||
 | 
					                "@typescript-eslint/strict-boolean-expressions": ["error", {
 | 
				
			||||||
 | 
					                    allowString: false,
 | 
				
			||||||
 | 
					                },],
 | 
				
			||||||
 | 
					                "comma-style": ["error", "last",], //  逗号在行位
 | 
				
			||||||
 | 
					                "array-bracket-spacing": ["error", "never",],
 | 
				
			||||||
 | 
					                "no-undef-init": "error",
 | 
				
			||||||
 | 
					                "no-invalid-this": "error",
 | 
				
			||||||
 | 
					                "no-use-before-define": "error",
 | 
				
			||||||
 | 
					                "no-shadow-restricted-names": "error", //  禁止对一些关键字或者保留字进行赋值操作,比如NaN、Infinity、undefined、eval、arguments等
 | 
				
			||||||
 | 
					                "prefer-const": "warn",
 | 
				
			||||||
 | 
					                "spaced-comment": "error",
 | 
				
			||||||
 | 
					                "space-before-function-paren": "off",
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					    ],
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
@@ -24,6 +24,10 @@ interface Archievement
 | 
				
			|||||||
    backward_list: string[];
 | 
					    backward_list: string[];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 获取部门业绩数据,并调用回调函数进行渲染。
 | 
				
			||||||
 | 
					 * @param render 用于给组件更新数据的回调函数
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
function queryDepartmentArchievement( render: any ): void
 | 
					function queryDepartmentArchievement( render: any ): void
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    instance.request( {
 | 
					    instance.request( {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -117,7 +117,7 @@ export default {
 | 
				
			|||||||
            router.push("/login");
 | 
					            router.push("/login");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return { ui, getTotalArchievement, };
 | 
					        return { ui, getTotalArchievement, requestArchievement, };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user