Skip to content

Commit 5127e69

Browse files
committed
chore: lint config
1 parent 643295e commit 5127e69

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

.eslintrc.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,12 @@ module.exports = {
2525
},
2626
ignorePatterns: ["node_modules", "build", "dist", "coverage", "public"],
2727
rules: {
28-
// 分号
2928
"semi": "error",
30-
// 对象键值引号样式保持一致
3129
"quote-props": ["error", "consistent-as-needed"],
32-
// 箭头函数允许单参数不带括号
3330
"arrow-parens": ["error", "as-needed"],
34-
// no var
3531
"no-var": "error",
36-
// const
3732
"prefer-const": "error",
38-
// 允许console
3933
"no-console": "off",
40-
// 关闭每个函数都要显式声明返回值
41-
// "@typescript-eslint/explicit-module-boundary-types": "off",
42-
// 偏好import type
4334
"@typescript-eslint/consistent-type-imports": "error",
4435
"simple-import-sort/imports": "error",
4536
"simple-import-sort/exports": "error",

.prettierrc.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
module.exports = {
2-
"printWidth": 100, // 指定代码长度,超出换行
3-
"tabWidth": 2, // tab 键的宽度
4-
"useTabs": false, // 不使用tab
5-
"semi": true, // 结尾加上分号
6-
"singleQuote": false, // 使用单引号
7-
"quoteProps": "preserve", // 不要求对象字面量属性是否使用引号包裹
8-
"jsxSingleQuote": false, // jsx 语法中使用单引号
9-
"trailingComma": "es5", // 确保对象的最后一个属性后有逗号
10-
"bracketSpacing": true, // 大括号有空格 { name: 'rose' }
11-
"arrowParens": "avoid", // 箭头函数,单个参数不强制添加括号
12-
"requirePragma": false, // 是否严格按照文件顶部的特殊注释格式化代码
13-
"insertPragma": false, // 是否在格式化的文件顶部插入Pragma标记,以表明该文件被prettier格式化过了
14-
"proseWrap": "preserve", // 按照文件原样折行
15-
"htmlWhitespaceSensitivity": "ignore", // html文件的空格敏感度,控制空格是否影响布局
16-
"endOfLine": "lf" // 结尾是 \n \r \n\r auto
17-
}
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": false,
7+
"quoteProps": "preserve",
8+
"jsxSingleQuote": false,
9+
"trailingComma": "es5",
10+
"bracketSpacing": true,
11+
"arrowParens": "avoid",
12+
"requirePragma": false,
13+
"insertPragma": false,
14+
"proseWrap": "preserve",
15+
"htmlWhitespaceSensitivity": "ignore",
16+
"endOfLine": "lf",
17+
};

0 commit comments

Comments
 (0)