添加了一些eslint的rule。

This commit is contained in:
Kane 2023-02-06 00:41:47 +08:00
parent 1763154fa2
commit 555611ca96
5 changed files with 36 additions and 19 deletions

View File

@ -2,8 +2,8 @@
* @Author: Kane
* @Date: 2022-12-14 15:12:46
* @LastEditors: Kane
* @LastEditTime: 2022-12-14 15:20:20
* @FilePath: \admin_system\.eslintrc.js
* @LastEditTime: 2023-02-06 00:36:26
* @FilePath: /IT工具综合平台/.eslintrc.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -11,17 +11,34 @@
module.exports = {
root: true,
env: {
node: true
node: true,
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
'eslint:recommended',
],
parserOptions: {
parser: '@babel/eslint-parser'
parser: '@babel/eslint-parser',
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
"no-unused-vars": "off",
"semi": ["error", "always",],//控制行尾部分号
"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, },],
},
};

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-01-04 11:30:33
* @LastEditors: Kane
* @LastEditTime: 2023-02-05 23:38:54
* @LastEditTime: 2023-02-06 00:25:26
* @FilePath: /IT/src/layout/components/Aside.vue
* @Description:
*
@ -54,8 +54,8 @@ export default {
name: "LayoutAside",
setup()
{
const router = useRouter();
const routes = router.getRoutes();
const router = useRouter();//
const routes = router.getRoutes();//
const store = useStore();
//

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-04 15:48:00
* @LastEditors: Kane
* @LastEditTime: 2023-02-05 11:47:17
* @LastEditTime: 2023-02-06 00:28:23
* @FilePath: /IT/src/utils/api/requirement/requirement.js
* @Description:
*
@ -42,8 +42,8 @@ function query_requirement_ui(requirement_store, error_page_name)
{
name: error_page_name,
query: {
error
}
error,
},
});
});
}

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-01-25 23:16:29
* @LastEditors: Kane
* @LastEditTime: 2023-02-04 15:46:29
* @LastEditTime: 2023-02-06 00:37:38
* @FilePath: /IT/src/views/requirement/RequirementEditing.vue
* @Description:
*

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-02 22:19:12
* @LastEditors: Kane
* @LastEditTime: 2023-02-05 23:05:12
* @LastEditTime: 2023-02-06 00:19:05
* @FilePath: /IT/src/views/requirement/RequirementManager.vue
* @Description:
*
@ -299,7 +299,7 @@ export default {
name: "RequirementEditing",
query: {
serial: "new",
}
},
});
};
@ -311,7 +311,7 @@ export default {
name: "RequirementEditing",
query: {
serial: requirement_serial,
}
},
});
};