From 929b6a6d75b95f9f1103e7745f49f7699b2d7427 Mon Sep 17 00:00:00 2001 From: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> Date: Sat, 5 Mar 2022 10:21:54 +0900 Subject: [PATCH] feat: loosen metrics rules level to `warn` (#1060) The ideal metrics are different for each project. So, `warn` should be suitable by default, instead of `error`. --- rules/core.js | 18 +++++++++--------- rules/plugins/react-jsx.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rules/core.js b/rules/core.js index 0db1b176..4e38d9a4 100644 --- a/rules/core.js +++ b/rules/core.js @@ -13,7 +13,7 @@ module.exports = { camelcase: ["error", { properties: "never" }], "capitalized-comments": "off", "class-methods-use-this": "warn", - complexity: "error", + complexity: "warn", "consistent-return": "error", "consistent-this": "off", "default-case": "error", @@ -32,14 +32,14 @@ module.exports = { "init-declarations": "off", "line-comment-position": "off", "lines-between-class-members": "error", - "max-classes-per-file": ["error", 5], - "max-depth": "error", - "max-lines": "error", - "max-lines-per-function": "error", - "max-nested-callbacks": "error", - "max-params": "error", - "max-statements": "error", - "max-statements-per-line": "error", + "max-classes-per-file": ["warn", 5], + "max-depth": "warn", + "max-lines": "warn", + "max-lines-per-function": "warn", + "max-nested-callbacks": "warn", + "max-params": "warn", + "max-statements": "warn", + "max-statements-per-line": "warn", "multiline-comment-style": "off", "new-cap": "error", "no-alert": "off", diff --git a/rules/plugins/react-jsx.js b/rules/plugins/react-jsx.js index 6b2d1a1e..272339ad 100644 --- a/rules/plugins/react-jsx.js +++ b/rules/plugins/react-jsx.js @@ -7,7 +7,7 @@ module.exports = { "react/jsx-filename-extension": ["error", { extensions: [".js", ".jsx", ".tsx"] }], "react/jsx-fragments": ["error", "syntax"], "react/jsx-handler-names": "error", - "react/jsx-max-depth": ["error", { max: 5 }], + "react/jsx-max-depth": ["warn", { max: 5 }], "react/jsx-newline": "off", "react/jsx-no-bind": [ "error",