From 0c7a41aeb8a946c2d3a2e984ad0d3ff51be3c974 Mon Sep 17 00:00:00 2001 From: Nigel Megitt Date: Mon, 15 Jul 2024 10:53:27 +0100 Subject: [PATCH] Make lint pass --- .eslintrc.js => .eslintrc.cjs | 5 ++++- src/AdNode.es6 | 2 +- src/AdSourceNode.es6 | 2 +- src/Parser.es6 | 8 ++++---- webpack.config.js | 28 ++++++++++++++-------------- 5 files changed, 24 insertions(+), 21 deletions(-) rename .eslintrc.js => .eslintrc.cjs (88%) diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 88% rename from .eslintrc.js rename to .eslintrc.cjs index 0b5e323..aae2925 100644 --- a/.eslintrc.js +++ b/.eslintrc.cjs @@ -28,7 +28,10 @@ module.exports = { "no-console": "off", - "sourceType": "module" + "comma-dangle": [ + "error", "always-multiline" + ], + // "sourceType": "module" // "max-statements": ["error", 30] diff --git a/src/AdNode.es6 b/src/AdNode.es6 index be93b18..c02559e 100644 --- a/src/AdNode.es6 +++ b/src/AdNode.es6 @@ -23,7 +23,7 @@ export default class AdNode { this.parent = parent; this.time = { begin: TimingCalculator.computeBegin(xmlNode), - end: undefined + end: undefined, }; this._name = xmlNode.name; diff --git a/src/AdSourceNode.es6 b/src/AdSourceNode.es6 index 691180d..f718268 100644 --- a/src/AdSourceNode.es6 +++ b/src/AdSourceNode.es6 @@ -23,7 +23,7 @@ const readyStateMap = { 1: "HAVE_METADATA", 2: "HAVE_CURRENT_DATA", 3: "HAVE_FUTURE_DATA", - 4: "HAVE_ENOUGH_DATA" + 4: "HAVE_ENOUGH_DATA", }; // This guy is a little weird - It's the input to it's parent; i.e. in the graph diff --git a/src/Parser.es6 b/src/Parser.es6 index dc0cb15..7060593 100644 --- a/src/Parser.es6 +++ b/src/Parser.es6 @@ -340,9 +340,9 @@ export default function parseTree(audioContext, media, url, xmlTree, startRoot) namespaces: { default: Utils.NS_TTML_URI, xml: Utils.NS_XML_URI, - tta: `${Utils.NS_TTML_AUDIO_URI}` + tta: `${Utils.NS_TTML_AUDIO_URI}`, }, - fullyQualifiedName: `${Utils.NS_TTML_URI}%%tt` + fullyQualifiedName: `${Utils.NS_TTML_URI}%%tt`, }, audioContext, mediaPair); @@ -352,9 +352,9 @@ export default function parseTree(audioContext, media, url, xmlTree, startRoot) name: "default audio out", attributes: {}, namespaces: { - xml: Utils.NS_XML_URI + xml: Utils.NS_XML_URI, }, - fullyQualifiedName: "" + fullyQualifiedName: "", }, audioContext); defaultOutput.makeDefaultOutput(); diff --git a/webpack.config.js b/webpack.config.js index 94f7d2a..d287b43 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -26,26 +26,26 @@ export default { ], mode: "development", entry: [ - "./src/index.es6" + "./src/index.es6", ], plugins: [ new CircularDependencyPlugin({ // `onStart` is called before the cycle detection starts - onStart({ compilation }) { - console.log('start detecting webpack modules cycles'); + onStart() { + console.log("start detecting webpack modules cycles"); }, // `onDetected` is called for each module that is cyclical - onDetected({ module: webpackModuleRecord, paths, compilation }) { + onDetected({ paths, compilation }) { // `paths` will be an Array of the relative module paths that make up the cycle // `module` will be the module record generated by webpack that caused the cycle - compilation.errors.push(new Error(paths.join(' -> '))) + compilation.errors.push(new Error(paths.join(" -> "))); }, // `onEnd` is called before the cycle detection ends - onEnd({ compilation }) { - console.log('end detecting webpack modules cycles'); + onEnd() { + console.log("end detecting webpack modules cycles"); }, cwd: process.cwd(), - }) + }), ], experiments: { outputModule: true, @@ -55,20 +55,20 @@ export default { filename: "./bin/js/bundle.js", library: { type: "module", - } + }, }, devServer: { contentBase: "./dist", index: "index.html", - watchContentBase: true + watchContentBase: true, }, module: { rules: [ { test: /\.(es6|js)$/, exclude: /node_modules/, - loader: "babel-loader" - } - ] - } + loader: "babel-loader", + }, + ], + }, };