保存进度!
This commit is contained in:
@@ -4,17 +4,62 @@ import tseslint from "typescript-eslint";
|
|||||||
import pluginVue from "eslint-plugin-vue";
|
import pluginVue from "eslint-plugin-vue";
|
||||||
import { defineConfig } from "eslint/config";
|
import { defineConfig } from "eslint/config";
|
||||||
import stylistic from "@stylistic/eslint-plugin";
|
import stylistic from "@stylistic/eslint-plugin";
|
||||||
// import eslintConfigPrettier from "eslint-config-prettier";
|
|
||||||
|
|
||||||
export default defineConfig([
|
export default defineConfig([
|
||||||
{
|
{
|
||||||
|
name: "通用设置",
|
||||||
files: ["**/*.{js,mjs,cjs,ts,mts,cts,vue}",],
|
files: ["**/*.{js,mjs,cjs,ts,mts,cts,vue}",],
|
||||||
plugins: { js, },
|
plugins: { js, },
|
||||||
extends: ["js/recommended",],
|
extends: ["js/recommended",],
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
globals: {
|
globals: {
|
||||||
...globals.browser,
|
...globals.browser,
|
||||||
...globals.node,}, },
|
...globals.node,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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",], // 逗号在行尾
|
||||||
|
"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, },],
|
||||||
|
"array-bracket-spacing": ["error", "never", {
|
||||||
|
singleValue: false,
|
||||||
|
objectsInArrays: false,
|
||||||
|
arraysInArrays: false,
|
||||||
|
},],
|
||||||
|
"brace-style": ["error", "allman", { allowSingleLine: true, },],
|
||||||
|
"prefer-const": "warn",
|
||||||
|
"space-before-function-paren": ["error", {
|
||||||
|
anonymous: "always",
|
||||||
|
named: "never",
|
||||||
|
asyncArrow: "always",
|
||||||
|
},],
|
||||||
|
"@stylistic/no-trailing-spaces": [ // 不允许末尾的空格
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"skipBlankLines": false,
|
||||||
|
"ignoreComments": false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
tseslint.configs.recommended,
|
tseslint.configs.recommended,
|
||||||
{
|
{
|
||||||
@@ -23,13 +68,13 @@ export default defineConfig([
|
|||||||
"@stylistic": stylistic,
|
"@stylistic": stylistic,
|
||||||
},
|
},
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
parserOptions: { parser: tseslint.parser, },
|
parserOptions: { parser: tseslint.parser, },
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
"spaced-comment": "error",
|
"spaced-comment": "error",
|
||||||
"space-before-function-paren": "off",
|
"space-before-function-paren": "off",
|
||||||
"semi-spacing": ["error", {"before": false,
|
"semi-spacing": ["error", { before: false,
|
||||||
"after": true,},],
|
after: true, },],
|
||||||
"@typescript-eslint/no-unused-vars": "warn",
|
"@typescript-eslint/no-unused-vars": "warn",
|
||||||
"@stylistic/indent": ["error", 4, { SwitchCase: 1, },],
|
"@stylistic/indent": ["error", 4, { SwitchCase: 1, },],
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
@@ -51,8 +96,11 @@ export default defineConfig([
|
|||||||
], // 数组和对象键值对最后一个逗号
|
], // 数组和对象键值对最后一个逗号
|
||||||
"@stylistic/quotes": ["error", "double",],
|
"@stylistic/quotes": ["error", "double",],
|
||||||
"@typescript-eslint/space-before-function-paren": "off",
|
"@typescript-eslint/space-before-function-paren": "off",
|
||||||
"@typescript-eslint/comma-spacing": ["off", { before: false,
|
"@typescript-eslint/comma-spacing": [
|
||||||
after: true, },], // 使用eslint的,不用ts的
|
"off",
|
||||||
|
{ before: false,
|
||||||
|
after: true, },
|
||||||
|
], // 使用eslint的,不用ts的
|
||||||
// "@typescript-eslint/strict-boolean-expressions": ["error", {
|
// "@typescript-eslint/strict-boolean-expressions": ["error", {
|
||||||
// allowString: false,
|
// allowString: false,
|
||||||
// },],
|
// },],
|
||||||
@@ -61,13 +109,13 @@ export default defineConfig([
|
|||||||
},
|
},
|
||||||
pluginVue.configs["flat/essential"],
|
pluginVue.configs["flat/essential"],
|
||||||
pluginVue.configs["flat/strongly-recommended"],
|
pluginVue.configs["flat/strongly-recommended"],
|
||||||
{
|
{
|
||||||
files: ["**/*.vue","**/.ts","eslint.config.ts",],
|
files: ["**/*.vue", "**/.ts", "eslint.config.ts",],
|
||||||
plugins: {
|
plugins: {
|
||||||
"@stylistic": stylistic,
|
"@stylistic": stylistic,
|
||||||
},
|
},
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
parserOptions: { parser: tseslint.parser, },
|
parserOptions: { parser: tseslint.parser, },
|
||||||
ecmaVersion: "latest",
|
ecmaVersion: "latest",
|
||||||
sourceType: "module",
|
sourceType: "module",
|
||||||
globals: globals.browser,
|
globals: globals.browser,
|
||||||
@@ -84,8 +132,8 @@ export default defineConfig([
|
|||||||
// },],
|
// },],
|
||||||
"spaced-comment": "error",
|
"spaced-comment": "error",
|
||||||
"space-before-function-paren": "off",
|
"space-before-function-paren": "off",
|
||||||
"semi-spacing": ["error", {"before": false,
|
"semi-spacing": ["error", { before: false,
|
||||||
"after": true,},],
|
after: true, },],
|
||||||
"@typescript-eslint/no-unused-vars": "warn",
|
"@typescript-eslint/no-unused-vars": "warn",
|
||||||
"@stylistic/indent": ["error", 4, { SwitchCase: 1, },],
|
"@stylistic/indent": ["error", 4, { SwitchCase: 1, },],
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
@@ -107,13 +155,15 @@ export default defineConfig([
|
|||||||
], // 数组和对象键值对最后一个逗号
|
], // 数组和对象键值对最后一个逗号
|
||||||
"@stylistic/quotes": ["error", "double",],
|
"@stylistic/quotes": ["error", "double",],
|
||||||
"@typescript-eslint/space-before-function-paren": "off",
|
"@typescript-eslint/space-before-function-paren": "off",
|
||||||
"@typescript-eslint/comma-spacing": ["off", { before: false,
|
"@typescript-eslint/comma-spacing": [
|
||||||
after: true, },], // 使用eslint的,不用ts的
|
"off",
|
||||||
|
{ before: false,
|
||||||
|
after: true, },
|
||||||
|
], // 使用eslint的,不用ts的
|
||||||
// "@typescript-eslint/strict-boolean-expressions": ["error", {
|
// "@typescript-eslint/strict-boolean-expressions": ["error", {
|
||||||
// allowString: false,
|
// allowString: false,
|
||||||
// },],
|
// },],
|
||||||
"@stylistic/object-property-newline": "warn",
|
"@stylistic/object-property-newline": "warn",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// eslintConfigPrettier,
|
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src="/vite.svg"
|
|
||||||
class="logo"
|
class="logo"
|
||||||
|
src="/vite.svg"
|
||||||
alt="Vite logo"
|
alt="Vite logo"
|
||||||
>
|
>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: Kane Wang <wangkane@qq.com>
|
* @Author: Kane Wang <wangkane@qq.com>
|
||||||
* @Date: 2026-01-05 10:42:42
|
* @Date: 2026-01-05 10:42:42
|
||||||
* @LastEditors: Kane Wang
|
* @LastEditors: Kane Wang
|
||||||
* @LastModified: 2026-02-03 18:15:32
|
* @LastModified: 2026-02-04 15:37:20
|
||||||
* @FilePath: src/utils/regulatory_utils.ts
|
* @FilePath: src/utils/regulatory_utils.ts
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
@@ -22,7 +22,7 @@ interface Render {
|
|||||||
( resonse: AddNewRegulatoryResponse ) :void, }
|
( resonse: AddNewRegulatoryResponse ) :void, }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param regulatory RegulatoryData类型制度对象,用于发送请求。
|
* @param regulatory RegulatoryData类型制度对象,用于发送请求。
|
||||||
* @param render 回调函数,请求成功后调用。
|
* @param render 回调函数,请求成功后调用。
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user