From 7a6e559fe5818ad2f0522281a06c4b7a03fe7c2e Mon Sep 17 00:00:00 2001 From: Ed S Date: Fri, 14 May 2021 10:48:37 +0100 Subject: [PATCH] Update eslint and other devDependencies (#391) * Update eslint and other devDependencies * Lint JS in examples/ using eslint-plugin-html (#392) --- Gruntfile.js | 5 +- examples/.eslintrc.json | 17 + examples/decorator.html | 4 +- examples/index-i18n.html | 10 +- examples/index-mobile.html | 13 +- examples/index-narrow.html | 32 +- examples/index.html | 6 +- examples/limitedLanguageList.html | 23 +- examples/resources/i18n/en.json | 2 +- examples/resources/i18n/ml.json | 2 +- examples/test-no-results.html | 8 +- package-lock.json | 22129 +++++++++++++--------------- package.json | 100 +- src/jquery.uls.core.js | 10 +- src/jquery.uls.data.utils.js | 22 +- src/jquery.uls.languagefilter.js | 7 +- src/jquery.uls.lcd.js | 11 +- 17 files changed, 10287 insertions(+), 12114 deletions(-) create mode 100644 examples/.eslintrc.json diff --git a/Gruntfile.js b/Gruntfile.js index c72b031..71d014b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -10,14 +10,13 @@ module.exports = function ( grunt ) { grunt.initConfig( { eslint: { options: { - extensions: [ '.js', '.json' ], cache: true }, all: [ - '**/*.{js,json}', + '**/*.{js,json,html}', '!src/jquery.uls.data.js', '!scripts/jquery.uls.data.template.js', - '!examples/**', + '!examples/resources/*.min.js', '!node_modules/**', '!vendor/**' ] diff --git a/examples/.eslintrc.json b/examples/.eslintrc.json new file mode 100644 index 0000000..d136f44 --- /dev/null +++ b/examples/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "root": true, + "extends": [ + "wikimedia/client", + "wikimedia/jquery" + ], + "rules": { + "no-jquery/no-global-selector": "off" + }, + "plugins": [ + "html" + ], + "settings": { + "html/indent": "+tab", + "html/report-bad-indent": "error" + } +} diff --git a/examples/decorator.html b/examples/decorator.html index 95293f6..fb1f341 100644 --- a/examples/decorator.html +++ b/examples/decorator.html @@ -18,7 +18,7 @@ diff --git a/examples/index-i18n.html b/examples/index-i18n.html index 673882c..1254cd4 100644 --- a/examples/index-i18n.html +++ b/examples/index-i18n.html @@ -19,16 +19,16 @@ diff --git a/examples/index-mobile.html b/examples/index-mobile.html index d63426a..03314a7 100644 --- a/examples/index-mobile.html +++ b/examples/index-mobile.html @@ -29,20 +29,21 @@ diff --git a/examples/index-narrow.html b/examples/index-narrow.html index 965beaa..0cf7e5f 100644 --- a/examples/index-narrow.html +++ b/examples/index-narrow.html @@ -18,23 +18,23 @@ diff --git a/examples/index.html b/examples/index.html index 4f1d211..92fc49a 100644 --- a/examples/index.html +++ b/examples/index.html @@ -28,13 +28,13 @@ diff --git a/examples/limitedLanguageList.html b/examples/limitedLanguageList.html index dfc96f2..36c8eaf 100644 --- a/examples/limitedLanguageList.html +++ b/examples/limitedLanguageList.html @@ -21,21 +21,22 @@