Parcourir la source

lint: add typedef rule for variable declarations (need declared type)

so you can't type 'let backend = osmd.Backends[0]' anymore, have to declare type

we could add this requirement for arrow parameters too,
but we have a lot of arrow parameters without types already (~25),
and a lot of them look ugly and unnecessarily explicit with types,
the type info is usually obvious there.
sschmid il y a 4 ans
Parent
commit
bcdc158e45
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      .eslintrc.js

+ 7 - 0
.eslintrc.js

@@ -91,6 +91,13 @@ module.exports = {
         "@typescript-eslint/semi": [
             "error"
         ],
+        "@typescript-eslint/typedef": [
+            "error",
+            {
+              "arrowParameter": false,
+              "variableDeclaration": true
+            }
+        ],
         "@typescript-eslint/type-annotation-spacing": "error",
         "brace-style": [
             "off",