dify
dify copied to clipboard
前端代码的格式化规范统一
你好,我想贡献代码,但是发现项目里没有统一代码格式化的配置。能否补充一下,方便我们以统一格式提交代码。
@iamjoel @nite-knite
下面我们会加 lint 之类的配置。目前的 rule 是这样的(web/.eslintrc.json):
{
"extends": [
"@antfu",
"plugin:react-hooks/recommended"
],
"rules": {
"@typescript-eslint/consistent-type-definitions": [
"error",
"type"
],
"no-console": "off",
"indent": "off",
"@typescript-eslint/indent": [
"error",
2,
{
"SwitchCase": 1,
"flatTernaryExpressions": false,
"ignoredNodes": [
"PropertyDefinition[decorators]",
"TSUnionType",
"FunctionExpression[params]:has(Identifier[decorators])"
]
}
],
"react-hooks/exhaustive-deps": "warning"
}
}
Added: https://github.com/langgenius/dify/pull/242