diff --git a/nkebao/.eslintrc.js b/nkebao/.eslintrc.js index 92249b4b..0ffa2239 100644 --- a/nkebao/.eslintrc.js +++ b/nkebao/.eslintrc.js @@ -10,7 +10,7 @@ module.exports = { "plugin:react/recommended", "plugin:react-hooks/recommended", "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", + "plugin:prettier/recommended", // 这个配置会自动处理大部分冲突 ], parser: "@typescript-eslint/parser", parserOptions: { @@ -32,8 +32,29 @@ module.exports = { "eol-last": "off", "no-empty": "warn", "prefer-const": "warn", - // 移除与Prettier冲突的规则 + // 确保与 Prettier 完全兼容 "comma-dangle": "off", + "comma-spacing": "off", + "comma-style": "off", + "object-curly-spacing": "off", + "array-bracket-spacing": "off", + indent: "off", + quotes: "off", + semi: "off", + "arrow-parens": "off", + "no-multiple-empty-lines": "off", + "max-len": "off", + "space-before-function-paren": "off", + "space-before-blocks": "off", + "keyword-spacing": "off", + "space-infix-ops": "off", + "space-in-parens": "off", + "space-in-brackets": "off", + "object-property-newline": "off", + "array-element-newline": "off", + "function-paren-newline": "off", + "object-curly-newline": "off", + "array-bracket-newline": "off", }, settings: { react: { diff --git a/nkebao/.prettierrc b/nkebao/.prettierrc index e3a5954f..588b7055 100644 --- a/nkebao/.prettierrc +++ b/nkebao/.prettierrc @@ -1,6 +1,6 @@ { "semi": true, - "trailingComma": "es5", + "trailingComma": "all", "singleQuote": false, "printWidth": 80, "tabWidth": 2, @@ -10,4 +10,4 @@ "arrowParens": "avoid", "jsxSingleQuote": false, "quoteProps": "as-needed" -} +} \ No newline at end of file