From e1bbc696efeea2a882666aabf56777b30d4b6fe2 Mon Sep 17 00:00:00 2001 From: Patrik Kullman Date: Tue, 13 Nov 2018 22:23:56 +0100 Subject: [PATCH 01/19] eslint - add object-shorthand and prefer-arrow-callback rules + reformat Signed-off-by: Patrik Kullman --- .eslintrc.json | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 765a6db..f54a37f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -26,7 +26,10 @@ ], "arrow-spacing": [ "error", - { "before": true, "after": true } + { + "before": true, + "after": true + } ], "brace-style": "error", "camelcase": "error", @@ -56,14 +59,14 @@ "key-spacing": [ "error", { - "afterColon": true, - "beforeColon": false + "afterColon": true, + "beforeColon": false } ], "keyword-spacing": [ "error", { - "before": true + "before": true } ], "no-console": "off", @@ -87,6 +90,10 @@ "no-use-before-define": "error", "no-useless-call": "error", "no-useless-concat": "error", + "object-shorthand": [ + "error", + "always" + ], "one-var": [ "error", { @@ -98,6 +105,7 @@ "error", "always" ], + "prefer-arrow-callback": "error", "quotes": [ "error", "single" @@ -114,12 +122,12 @@ "space-before-function-paren": [ "error", { - "anonymous": "always", - "named": "never" + "anonymous": "always", + "named": "never" } ], "space-in-parens": "error", "space-infix-ops": "error", "valid-jsdoc": "warn" } -} +} \ No newline at end of file From e3f1da1a5cf535f8a829477d95568fc11196d781 Mon Sep 17 00:00:00 2001 From: Patrik Kullman Date: Tue, 13 Nov 2018 22:24:40 +0100 Subject: [PATCH 02/19] vscode settings - drop bower_components-1.x filewatch exclude (not present anymore) Signed-off-by: Patrik Kullman --- .vscode/settings.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2efe4c1..e9b6d66 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,7 +10,6 @@ "**/.git/objects/**": true, "**/.git/subtree-cache/**": true, "**/node_modules/**": true, - "**/bower_components/**": true, - "**/bower_components-1.x/**": true + "**/bower_components/**": true } } From 49e8ccb079b3cd6dddc196337327d826d0d5c636 Mon Sep 17 00:00:00 2001 From: Patrik Kullman Date: Tue, 13 Nov 2018 22:25:10 +0100 Subject: [PATCH 03/19] package.json - move package.lock wipe to preinstall hook Avoids yarn warning about dual lockfiles Signed-off-by: Patrik Kullman --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 01c4141..76cea45 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,12 @@ }, "scripts": { "start": "polymer serve -o", + "preinstall": "rm -f package.lock", "postinstall": "polymer install && yarn sync-npm", "lint": "eslint --cache --cache-location .eslintcache/ --ext .js,.html . && polymer lint cosmoz-*.html", "test": "polymer test", "analyze": "polymer analyze --input cosmoz-*.html > analysis.json", - "sync-npm": "rm -f package-lock.json && npm shrinkwrap && mv npm-shrinkwrap.json package-lock.json" + "sync-npm": "npm shrinkwrap && mv npm-shrinkwrap.json package-lock.json" }, "repository": { "type": "git", From 09ac45ec62101a9551a2d54d0741fa16700b0225 Mon Sep 17 00:00:00 2001 From: Patrik Kullman Date: Tue, 13 Nov 2018 22:25:52 +0100 Subject: [PATCH 04/19] polymer.json - switch from hybrid to native polymer-2 linting rules Signed-off-by: Patrik Kullman --- polymer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polymer.json b/polymer.json index 8c2be05..b7868c1 100644 --- a/polymer.json +++ b/polymer.json @@ -1,5 +1,5 @@ { "lint": { - "rules": ["polymer-2-hybrid"] + "rules": ["polymer-2"] } } From 172da37fb1e2264696387019c11f305d05bd2667 Mon Sep 17 00:00:00 2001 From: Patrik Kullman Date: Tue, 13 Nov 2018 22:38:18 +0100 Subject: [PATCH 05/19] Polymer 2.x native misc updates - Update element imports - Switch demo and test helpers to class-based elements - Adjust for 2.x native custom-style approach - Use native addEventListener for resizable helper -- sinon.spy for _onIronResize() doesn't work with class methods --- test fails Signed-off-by: Patrik Kullman --- cosmoz-data-nav.html | 4 +- demo/helpers/cosmoz-demo-view.html | 49 ++++---- demo/index.html | 95 +++++++++------- test/basic.html | 10 +- .../cosmoz-data-nav-resizable-view.html | 59 +++++----- test/helpers/cosmoz-data-nav-test-view.html | 19 ++-- test/resizable.html | 107 ++++++++++-------- 7 files changed, 186 insertions(+), 157 deletions(-) diff --git a/cosmoz-data-nav.html b/cosmoz-data-nav.html index 9c23f35..2cea595 100644 --- a/cosmoz-data-nav.html +++ b/cosmoz-data-nav.html @@ -1,4 +1,6 @@ - + + + diff --git a/demo/helpers/cosmoz-demo-view.html b/demo/helpers/cosmoz-demo-view.html index a4fcb23..e1eb7c5 100644 --- a/demo/helpers/cosmoz-demo-view.html +++ b/demo/helpers/cosmoz-demo-view.html @@ -1,9 +1,9 @@ - + -