Update lint and tests (#1388)
* Update paths to no longer use bg/, fg/, or mixed/ * Only allow modal-jquery.js to use jQuery
This commit is contained in:
parent
e419a418f6
commit
0117df6bd8
@ -12,8 +12,7 @@
|
|||||||
},
|
},
|
||||||
"plugins": ["no-unsanitized"],
|
"plugins": ["no-unsanitized"],
|
||||||
"ignorePatterns": [
|
"ignorePatterns": [
|
||||||
"/ext/lib/",
|
"/ext/lib/"
|
||||||
"/ext/bg/js/templates.js"
|
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"arrow-parens": ["error", "always"],
|
"arrow-parens": ["error", "always"],
|
||||||
@ -134,7 +133,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["ext/js/settings/*.js"],
|
"files": ["ext/js/settings/modal-jquery.js"],
|
||||||
"env": {
|
"env": {
|
||||||
"jquery": true
|
"jquery": true
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ const path = require('path');
|
|||||||
const browserify = require('browserify');
|
const browserify = require('browserify');
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const extLibPath = path.join(__dirname, '..', 'ext', 'mixed', 'lib');
|
const extLibPath = path.join(__dirname, '..', 'ext', 'lib');
|
||||||
const parse5Path = require.resolve('parse5');
|
const parse5Path = require.resolve('parse5');
|
||||||
|
|
||||||
const content = await new Promise((resolve, reject) => {
|
const content = await new Promise((resolve, reject) => {
|
||||||
|
@ -117,7 +117,7 @@ function main() {
|
|||||||
const fix = (process.argv.length >= 2 && process.argv[2] === '--fix');
|
const fix = (process.argv.length >= 2 && process.argv[2] === '--fix');
|
||||||
const directory = path.resolve(__dirname, '..', '..', 'ext');
|
const directory = path.resolve(__dirname, '..', '..', 'ext');
|
||||||
const pattern = /\.js$/;
|
const pattern = /\.js$/;
|
||||||
const ignorePattern = /[\\/]ext[\\/]mixed[\\/]lib[\\/]/;
|
const ignorePattern = /[\\/]ext[\\/]lib[\\/]/;
|
||||||
const fileNames = getAllFiles(directory, null, (f) => pattern.test(f) && !ignorePattern.test(f));
|
const fileNames = getAllFiles(directory, null, (f) => pattern.test(f) && !ignorePattern.test(f));
|
||||||
for (const fileName of fileNames) {
|
for (const fileName of fileNames) {
|
||||||
if (!validateGlobals(fileName, fix)) {
|
if (!validateGlobals(fileName, fix)) {
|
||||||
|
@ -63,7 +63,7 @@ function main() {
|
|||||||
try {
|
try {
|
||||||
const extDir = path.resolve(__dirname, '..', '..', 'ext');
|
const extDir = path.resolve(__dirname, '..', '..', 'ext');
|
||||||
const pattern = /\.html$/;
|
const pattern = /\.html$/;
|
||||||
const ignorePattern = /[\\/]ext[\\/]mixed[\\/]lib[\\/]/;
|
const ignorePattern = /[\\/]ext[\\/]lib[\\/]/;
|
||||||
const fileNames = getAllFiles(extDir, null, (f) => pattern.test(f) && !ignorePattern.test(f));
|
const fileNames = getAllFiles(extDir, null, (f) => pattern.test(f) && !ignorePattern.test(f));
|
||||||
for (const fileName of fileNames) {
|
for (const fileName of fileNames) {
|
||||||
validateHtmlScripts(fileName, extDir);
|
validateHtmlScripts(fileName, extDir);
|
||||||
|
Loading…
Reference in New Issue
Block a user