前端代码的格式化规范统一 #88

Closed
opened 2026-02-21 17:25:56 -05:00 by yindo · 3 comments
Owner

Originally created by @saifeiLee on GitHub (May 23, 2023).

Originally assigned to: @nite-knite, @iamjoel on GitHub.

你好,我想贡献代码,但是发现项目里没有统一代码格式化的配置。能否补充一下,方便我们以统一格式提交代码。

Originally created by @saifeiLee on GitHub (May 23, 2023). Originally assigned to: @nite-knite, @iamjoel on GitHub. 你好,我想贡献代码,但是发现项目里没有统一代码格式化的配置。能否补充一下,方便我们以统一格式提交代码。
yindo added the 💪 enhancementgood first issue labels 2026-02-21 17:25:56 -05:00
yindo closed this issue 2026-02-21 17:25:57 -05:00
Author
Owner

@JohnJyong commented on GitHub (May 23, 2023):

@iamjoel @nite-knite

@JohnJyong commented on GitHub (May 23, 2023): @iamjoel @nite-knite
Author
Owner

@iamjoel commented on GitHub (May 24, 2023):

下面我们会加 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"
  }
}
@iamjoel commented on GitHub (May 24, 2023): 下面我们会加 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" } } ```
Author
Owner

@iamjoel commented on GitHub (May 29, 2023):

Added: https://github.com/langgenius/dify/pull/242

@iamjoel commented on GitHub (May 29, 2023): Added: https://github.com/langgenius/dify/pull/242
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#88