保存进度!

This commit is contained in:
Kane 2023-03-31 23:58:41 +08:00
parent 88006b2db9
commit c04c6e8365
2 changed files with 43 additions and 41 deletions

View File

@ -21,35 +21,35 @@ module.exports = {
}, },
extends:["eslint:recommended",], extends:["eslint:recommended",],
rules:{ rules:{
indent: [ "warn", 4, ], indent: ["warn", 4,],
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格 // 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
"space-in-parens": [ "error", "always", { exceptions: [ "{}", "[]", "()", "empty", ], },], "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "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": "warn", "no-unused-vars": "warn",
semi: [ "error", "always", ], // 控制行尾部分号 semi: ["error", "always",], // 控制行尾部分号
quotes: [ "error", "double", ], quotes: ["error", "double",],
"comma-dangle": [ "error", { "comma-dangle": ["error", {
arrays: "always", arrays: "always",
objects: "always", objects: "always",
imports: "never", imports: "never",
exports: "never", exports: "never",
functions: "never", functions: "never",
},], // 数组和对象键值对最后一个逗号 },], // 数组和对象键值对最后一个逗号
"comma-style": [ "error", "last", ], // 逗号在行位 "comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": [ "error", "always", {
singleValue: false,
objectsInArrays: false,
arraysInArrays: false,
},],
"no-undef-init": "error", "no-undef-init": "error",
"no-invalid-this": "error", "no-invalid-this": "error",
"no-use-before-define": "error", "no-use-before-define": "error",
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等 "no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等
"comma-spacing": [ "error", { before: false, after: true, },], "comma-spacing": ["error", { before: false, after: true, },],
"brace-style": [ "error", "allman", { allowSingleLine: true, },], "array-bracket-spacing": ["error", "never", {
singleValue: false,
objectsInArrays: false,
arraysInArrays: false,
},],
"brace-style": ["error", "allman", { allowSingleLine: true, },],
"prefer-const": "warn", "prefer-const": "warn",
"space-before-function-paren": [ "error", { "space-before-function-paren": ["error", {
anonymous: "always", anonymous: "always",
named: "never", named: "never",
asyncArrow: "always", asyncArrow: "always",
@ -78,23 +78,23 @@ module.exports = {
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
], ],
rules: { rules: {
indent: [ "warn", 4, ], indent: ["warn", 4,],
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格 // 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
"space-in-parens": [ "error", "always", { exceptions: [ "{}", "[]", "()", "empty", ], },], "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "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": "warn", "no-unused-vars": "warn",
semi: [ "error", "always", ], // 控制行尾部分号 semi: ["error", "always",], // 控制行尾部分号
quotes: [ "error", "double", ], quotes: ["error", "double",],
"comma-dangle": [ "error", { "comma-dangle": ["error", {
arrays: "always", arrays: "always",
objects: "always", objects: "always",
imports: "never", imports: "never",
exports: "never", exports: "never",
functions: "never", functions: "never",
},], // 数组和对象键值对最后一个逗号 },], // 数组和对象键值对最后一个逗号
"comma-style": [ "error", "last", ], // 逗号在行位 "comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": [ "error", "always", { "array-bracket-spacing": ["error", "always", {
singleValue: false, singleValue: false,
objectsInArrays: false, objectsInArrays: false,
arraysInArrays: false, arraysInArrays: false,
@ -103,33 +103,33 @@ module.exports = {
"no-invalid-this": "error", "no-invalid-this": "error",
"no-use-before-define": "error", "no-use-before-define": "error",
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等 "no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等
"comma-spacing": [ "error", { before: false, after: true, },], "comma-spacing": ["error", { before: false, after: true, },],
"brace-style": [ "error", "allman", { allowSingleLine: true, },], "brace-style": ["error", "allman", { allowSingleLine: true, },],
"prefer-const": "warn", "prefer-const": "warn",
"space-before-function-paren": [ "error", { "space-before-function-paren": ["error", {
anonymous: "always", anonymous: "always",
named: "never", named: "never",
asyncArrow: "always", asyncArrow: "always",
},], },],
// vue // vue
"vue/html-indent": [ "error", 4, ], "vue/html-indent": ["error", 4,],
// typescript // typescript
"@typescript-eslint/indent": [ "warn", 4, ], "@typescript-eslint/indent": ["warn", 4,],
"@typescript-eslint/no-extra-semi": "off", "@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": "warn", "@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/ban-ts-comment": "warn", "@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/member-delimiter-style": "off", "@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/semi": [ "error", "always", ], // 控制行尾部分号 "@typescript-eslint/semi": ["error", "always",], // 控制行尾部分号
"@typescript-eslint/brace-style": [ "error", "allman", { allowSingleLine: true, },], "@typescript-eslint/brace-style": ["error", "allman", { allowSingleLine: true, },],
"@typescript-eslint/comma-dangle": [ "error", { "@typescript-eslint/comma-dangle": ["error", {
arrays: "always", arrays: "always",
objects: "always", objects: "always",
imports: "never", imports: "never",
exports: "never", exports: "never",
functions: "never", functions: "never",
},], // 数组和对象键值对最后一个逗号 },], // 数组和对象键值对最后一个逗号
"@typescript-eslint/quotes": [ "error", "double", ], "@typescript-eslint/quotes": ["error", "double",],
"@typescript-eslint/space-before-function-paren": "off", "@typescript-eslint/space-before-function-paren": "off",
}, },
}, },
@ -141,38 +141,40 @@ module.exports = {
}, },
plugins: ["@typescript-eslint",], plugins: ["@typescript-eslint",],
extends: [ extends: [
"standard-with-typescript",
"eslint:recommended", "eslint:recommended",
"standard-with-typescript",
"plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
], ],
rules: { rules: {
// 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格 // 圆括号中的空格,为空不加空格,紧跟花括号、方括号、圆括号时也不加入空格
"space-in-parens": [ "error", "always", { exceptions: [ "{}", "[]", "()", "empty", ], },], "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "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",
"@typescript-eslint/indent": [ "error", 4, ], "@typescript-eslint/indent": ["error", 4,],
"@typescript-eslint/no-extra-semi": "off", "@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off", "@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": "warn", "@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/ban-ts-comment": "warn", "@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/member-delimiter-style": "off", "@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/semi": [ "error", "always", ], // 控制行尾部分号 "@typescript-eslint/semi": ["error", "always",], // 控制行尾部分号
"@typescript-eslint/brace-style": [ "error", "allman", { allowSingleLine: true, },], "@typescript-eslint/brace-style": ["error", "allman", { allowSingleLine: true, },],
"@typescript-eslint/comma-dangle": [ "error", { "@typescript-eslint/comma-dangle": ["error", {
arrays: "always", arrays: "always",
objects: "always", objects: "always",
imports: "never", imports: "never",
exports: "never", exports: "never",
functions: "never", functions: "never",
},], // 数组和对象键值对最后一个逗号 },], // 数组和对象键值对最后一个逗号
"@typescript-eslint/quotes": [ "error", "double", ], "@typescript-eslint/quotes": ["error", "double",],
"@typescript-eslint/space-before-function-paren": "off", "@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/strict-boolean-expressions": [ "error", { "@typescript-eslint/strict-boolean-expressions": ["error", {
allowString: false, allowString: false,
},], },],
"comma-style": [ "error", "last", ], // 逗号在行位 "comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": [ "error", "always", { "comma-spacing": ["off", { before: false, after: true, },],
"@typescript-eslint/comma-spacing": ["error", { before: false, after: true, },], // 使用eslint的不用ts的
"array-bracket-spacing": ["error", "always", {
singleValue: false, singleValue: false,
objectsInArrays: false, objectsInArrays: false,
arraysInArrays: false, arraysInArrays: false,

View File

@ -14,7 +14,7 @@ interface Cat
{ {
name: string; name: string;
purrs: boolean; purrs: boolean;
}; }
interface Dog interface Dog
{ {