Przeglądaj źródła

feat: bump linter and minifier from ECMAScript 2017 to 2020 (ES11)

Frédéric Guillot 1 rok temu
rodzic
commit
c9c422b135

+ 1 - 1
internal/ui/static/js/.eslintrc.json

@@ -1,7 +1,7 @@
 {
     "env": {
         "browser": true,
-        "es2017": true
+        "es2020": true
     },
     "rules": {
         "indent": ["error", 4]

+ 5 - 6
internal/ui/static/js/.jshintrc

@@ -1,16 +1,15 @@
 {
-  "esversion": 11,
   "bitwise": true,
+  "browser": true,
   "eqeqeq": true,
+  "esversion": 11,
   "freeze": true,
-  "nonew": true,
   "latedef": "nofunc",
   "noarg": true,
   "nocomma": true,
   "nonbsp": true,
   "nonew": true,
-  "browser": true,
+  "noreturnawait": true,
   "shadow": true,
-  "varstmt": true,
-  "noreturnawait": true
-}
+  "varstmt": true
+}

+ 1 - 1
internal/ui/static/static.go

@@ -139,7 +139,7 @@ func GenerateJavascriptBundles() error {
 	JavascriptBundles = make(map[string][]byte)
 	JavascriptBundleChecksums = make(map[string]string)
 
-	jsMinifier := js.Minifier{Version: 2017}
+	jsMinifier := js.Minifier{Version: 2020}
 
 	minifier := minify.New()
 	minifier.AddFunc("text/javascript", jsMinifier.Minify)