Sfoglia il codice sorgente

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 4 anni fa
parent
commit
bcdc158e45
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  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",