From 3240d52564adbf1035c13534010a52d6f9b6bd36 Mon Sep 17 00:00:00 2001 From: Anik Das Date: Sat, 4 Sep 2021 04:17:04 +0530 Subject: [PATCH] feat: added eslint eqeqeq rule, closes #5238 (#5614) * chore: add eslint eqeqeq rule Signed-off-by: Anik Das * fix: === in place of == from eslint changed != to !== as well. some vue components also used == in v-if which did not show up in eslint for some reason? changed them as well Signed-off-by: Anik Das --- .eslintrc.json | 1 + openlibrary/components/LibraryExplorer.vue | 2 +- .../LibraryExplorer/components/BookRoom.vue | 8 +- .../components/ClassSlider.vue | 6 +- .../components/FlatBookCover.vue | 4 +- .../components/LibraryToolbar.vue | 10 +- .../LibraryExplorer/components/OLCarousel.vue | 16 ++-- .../LibraryExplorer/components/Shelf.vue | 4 +- .../LibraryExplorer/components/ShelfIndex.vue | 4 +- .../LibraryExplorer/components/ShelfLabel.vue | 2 +- .../components/ShelfProgressBar.vue | 4 +- .../components/LibraryExplorer/configs.js | 4 +- .../components/LibraryExplorer/utils.js | 8 +- .../components/LibraryExplorer/utils/lcc.js | 2 +- .../plugins/openlibrary/js/SearchBar.js | 6 +- .../plugins/openlibrary/js/SearchUtils.js | 10 +- .../plugins/openlibrary/js/add_new_field.js | 6 +- .../openlibrary/js/carousel/Carousel.js | 4 +- openlibrary/plugins/openlibrary/js/edit.js | 16 ++-- .../openlibrary/js/goodreads_import.js | 6 +- .../plugins/openlibrary/js/graphs/plot.js | 6 +- openlibrary/plugins/openlibrary/js/i18n.js | 4 +- openlibrary/plugins/openlibrary/js/index.js | 2 +- .../plugins/openlibrary/js/jquery.repeat.js | 2 +- openlibrary/plugins/openlibrary/js/jsdef.js | 12 +-- .../openlibrary/js/markdown-editor/index.js | 2 +- .../js/page-barcodescanner/LazyBookCard.js | 10 +- .../js/page-barcodescanner/index.js | 4 +- .../openlibrary/js/readinglog_stats.js | 10 +- .../js/realtime_account_validation.js | 6 +- openlibrary/plugins/openlibrary/js/search.js | 8 +- .../plugins/openlibrary/js/subjects.js | 12 +-- .../plugins/openlibrary/js/template.js | 2 +- scripts/2009/01/olpc/src/js/carousel.js | 30 +++--- scripts/2009/01/olpc/src/js/jquery.cluetip.js | 42 ++++----- .../2009/01/olpc/src/js/jquery.easing.1.3.js | 6 +- .../2009/01/olpc/src/js/jquery.hoverIntent.js | 16 ++-- scripts/2009/01/olpc/src/js/olpcbook.js | 2 +- tests/unit/js/test.search.js | 4 +- vendor/js/jquery-form/jquery.form.js | 92 +++++++++---------- 40 files changed, 198 insertions(+), 197 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 241aa77363b..e1e289b19e2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,6 +19,7 @@ "globals": {}, "rules": { "prefer-template": "error", + "eqeqeq": ["error", "always"], "quotes": ["error", "single"], "eol-last": ["error", "always"], "indent": 2, diff --git a/openlibrary/components/LibraryExplorer.vue b/openlibrary/components/LibraryExplorer.vue index 139f92c5fe5..9b9cd7e1ba3 100644 --- a/openlibrary/components/LibraryExplorer.vue +++ b/openlibrary/components/LibraryExplorer.vue @@ -102,7 +102,7 @@ export default { let jumpTo = null; if (urlParams.has('jumpTo')) { const [classificationName, classificationString] = urlParams.get('jumpTo').split(':'); - selectedClassification = classifications.find(c => c.field == classificationName); + selectedClassification = classifications.find(c => c.field === classificationName); jumpTo = selectedClassification.toQueryFormat(classificationString); } return { diff --git a/openlibrary/components/LibraryExplorer/components/BookRoom.vue b/openlibrary/components/LibraryExplorer/components/BookRoom.vue index 30dab5c8cac..30d65e8b3cb 100644 --- a/openlibrary/components/LibraryExplorer/components/BookRoom.vue +++ b/openlibrary/components/LibraryExplorer/components/BookRoom.vue @@ -2,7 +2,7 @@