ソースを参照

port custom eslint rules

dwelle 1 年間 前
コミット
d77627fbcf
1 ファイル変更36 行追加8 行削除
  1. 36 8
      .eslintrc.json

+ 36 - 8
.eslintrc.json

@@ -1,15 +1,43 @@
 {
-  "extends": [
-    "plugin:react-hooks/recommended"
-  ],
+  "extends": ["plugin:react-hooks/recommended"],
   "parser": "@typescript-eslint/parser",
-  "plugins": [
-    "react",
-    "@typescript-eslint"
-  ],
+  "plugins": ["react", "@typescript-eslint"],
   "root": true,
   "rules": {
     "import/no-anonymous-default-export": "off",
-    "no-restricted-globals": "off"
+    "no-restricted-globals": "off",
+    "@typescript-eslint/no-unused-vars": "warn",
+    "curly": "warn",
+    "dot-notation": "warn",
+    "no-console": [
+      "warn",
+      {
+        "allow": ["warn", "error", "info"]
+      }
+    ],
+    "no-else-return": "warn",
+    "no-lonely-if": "warn",
+    "no-restricted-syntax": [
+      "warn",
+      {
+        "message": "Use 't(...)' instead of literal text in JSX",
+        "selector": "JSXText[value=/\\w/]"
+      }
+    ],
+    "no-unneeded-ternary": "warn",
+    "no-unused-expressions": "warn",
+    "no-unused-vars": "off",
+    "no-useless-return": "warn",
+    "no-var": "warn",
+    "object-shorthand": "warn",
+    "one-var": ["warn", "never"],
+    "prefer-arrow-callback": "warn",
+    "prefer-const": [
+      "warn",
+      {
+        "destructuring": "all"
+      }
+    ],
+    "prefer-template": "warn"
   }
 }