From 0117df6bd8b1603fec0eb5b8d840e777372f47c8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 14 Feb 2021 11:24:43 -0500 Subject: [PATCH] Update lint and tests (#1388) * Update paths to no longer use bg/, fg/, or mixed/ * Only allow modal-jquery.js to use jQuery --- .eslintrc.json | 5 ++--- dev/build-libs.js | 2 +- dev/lint/global-declarations.js | 2 +- dev/lint/html-scripts.js | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index fce741ae..de98fc81 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,8 +12,7 @@ }, "plugins": ["no-unsanitized"], "ignorePatterns": [ - "/ext/lib/", - "/ext/bg/js/templates.js" + "/ext/lib/" ], "rules": { "arrow-parens": ["error", "always"], @@ -134,7 +133,7 @@ } }, { - "files": ["ext/js/settings/*.js"], + "files": ["ext/js/settings/modal-jquery.js"], "env": { "jquery": true } diff --git a/dev/build-libs.js b/dev/build-libs.js index 2831457e..562b77fd 100644 --- a/dev/build-libs.js +++ b/dev/build-libs.js @@ -20,7 +20,7 @@ const path = require('path'); const browserify = require('browserify'); async function main() { - const extLibPath = path.join(__dirname, '..', 'ext', 'mixed', 'lib'); + const extLibPath = path.join(__dirname, '..', 'ext', 'lib'); const parse5Path = require.resolve('parse5'); const content = await new Promise((resolve, reject) => { diff --git a/dev/lint/global-declarations.js b/dev/lint/global-declarations.js index 03cf74f4..61739c42 100644 --- a/dev/lint/global-declarations.js +++ b/dev/lint/global-declarations.js @@ -117,7 +117,7 @@ function main() { const fix = (process.argv.length >= 2 && process.argv[2] === '--fix'); const directory = path.resolve(__dirname, '..', '..', 'ext'); const pattern = /\.js$/; - const ignorePattern = /[\\/]ext[\\/]mixed[\\/]lib[\\/]/; + const ignorePattern = /[\\/]ext[\\/]lib[\\/]/; const fileNames = getAllFiles(directory, null, (f) => pattern.test(f) && !ignorePattern.test(f)); for (const fileName of fileNames) { if (!validateGlobals(fileName, fix)) { diff --git a/dev/lint/html-scripts.js b/dev/lint/html-scripts.js index 04d5cc84..dec8a3dd 100644 --- a/dev/lint/html-scripts.js +++ b/dev/lint/html-scripts.js @@ -63,7 +63,7 @@ function main() { try { const extDir = path.resolve(__dirname, '..', '..', 'ext'); const pattern = /\.html$/; - const ignorePattern = /[\\/]ext[\\/]mixed[\\/]lib[\\/]/; + const ignorePattern = /[\\/]ext[\\/]lib[\\/]/; const fileNames = getAllFiles(extDir, null, (f) => pattern.test(f) && !ignorePattern.test(f)); for (const fileName of fileNames) { validateHtmlScripts(fileName, extDir);