Skip to content

Commit

Permalink
chore: lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
WindRunnerMax committed Nov 7, 2024
1 parent 643295e commit 5127e69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
9 changes: 0 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,12 @@ module.exports = {
},
ignorePatterns: ["node_modules", "build", "dist", "coverage", "public"],
rules: {
// 分号
"semi": "error",
// 对象键值引号样式保持一致
"quote-props": ["error", "consistent-as-needed"],
// 箭头函数允许单参数不带括号
"arrow-parens": ["error", "as-needed"],
// no var
"no-var": "error",
// const
"prefer-const": "error",
// 允许console
"no-console": "off",
// 关闭每个函数都要显式声明返回值
// "@typescript-eslint/explicit-module-boundary-types": "off",
// 偏好import type
"@typescript-eslint/consistent-type-imports": "error",
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
Expand Down
32 changes: 16 additions & 16 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module.exports = {
"printWidth": 100, // 指定代码长度,超出换行
"tabWidth": 2, // tab 键的宽度
"useTabs": false, // 不使用tab
"semi": true, // 结尾加上分号
"singleQuote": false, // 使用单引号
"quoteProps": "preserve", // 不要求对象字面量属性是否使用引号包裹
"jsxSingleQuote": false, // jsx 语法中使用单引号
"trailingComma": "es5", // 确保对象的最后一个属性后有逗号
"bracketSpacing": true, // 大括号有空格 { name: 'rose' }
"arrowParens": "avoid", // 箭头函数,单个参数不强制添加括号
"requirePragma": false, // 是否严格按照文件顶部的特殊注释格式化代码
"insertPragma": false, // 是否在格式化的文件顶部插入Pragma标记,以表明该文件被prettier格式化过了
"proseWrap": "preserve", // 按照文件原样折行
"htmlWhitespaceSensitivity": "ignore", // html文件的空格敏感度,控制空格是否影响布局
"endOfLine": "lf" // 结尾是 \n \r \n\r auto
}
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "preserve",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "avoid",
"requirePragma": false,
"insertPragma": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "ignore",
"endOfLine": "lf",
};

0 comments on commit 5127e69

Please sign in to comment.