Skip to content

Commit 1b1e673

Browse files
committed
Update dependencies, fix lint config and failures
1 parent 6915772 commit 1b1e673

15 files changed

Lines changed: 193 additions & 123 deletions

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 43 deletions
This file was deleted.

eslint.config.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import babelParser from "@babel/eslint-parser";
3+
import globals from "globals";
4+
5+
export default defineConfig([
6+
{
7+
languageOptions: {
8+
parser: babelParser,
9+
globals: {
10+
...globals.browser,
11+
...globals.node,
12+
},
13+
},
14+
extends: [
15+
],
16+
plugins: {
17+
},
18+
rules: {
19+
"no-empty-label": 0,
20+
"no-labels": 1,
21+
22+
"no-arrow-condition": 0,
23+
"no-confusing-arrow": 2,
24+
"no-constant-condition": 2,
25+
26+
"space-after-keywords": 0,
27+
"space-before-keywords": 0,
28+
"space-return-throw-case": 0,
29+
"keyword-spacing": 2,
30+
31+
"filenames/filenames": 0,
32+
33+
"no-magic-numbers": 0,
34+
"consistent-this": 0,
35+
"prefer-template": 0,
36+
"max-len": [
37+
"warn",
38+
{
39+
code: 100,
40+
},
41+
],
42+
43+
"max-params": ["error", 6],
44+
45+
"no-console": "off",
46+
47+
"comma-dangle": [
48+
"error",
49+
"always-multiline",
50+
],
51+
// "sourceType": "module"
52+
53+
// "max-statements": ["error", 30]
54+
55+
},
56+
// globalIgnores(["dist/**/*"], "Ignore Dist Directory"),
57+
// Note: there should be no other properties in this object
58+
ignores: [
59+
"dist/**/*",
60+
"**/*.min.js",
61+
"**/*.min.es6",
62+
"rollup.config.js",
63+
],
64+
},
65+
]);

package-lock.json

Lines changed: 26 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,26 @@
3737
"license": "Apache-2.0",
3838
"dependencies": {
3939
"@ava/babel-preset-stage-4": "4.0.0",
40+
"globals": "^17.4.0",
4041
"xml-query": "1.5.0",
4142
"xml-reader": "2.4.3"
4243
},
4344
"devDependencies": {
4445
"@babel/core": "7.29.0",
4546
"@babel/eslint-parser": "7.28.6",
47+
"@babel/plugin-transform-class-properties": "^7.28.6",
4648
"@babel/preset-env": "7.29.2",
4749
"@babel/register": "7.28.6",
48-
"circular-dependency-plugin": "^5.2.2",
4950
"@cucumber/cucumber": "12.7.0",
5051
"@html-eslint/eslint-plugin": "^0.58.1",
5152
"@html-eslint/parser": "^0.58.1",
5253
"ava": "^7.0.0",
5354
"babel-loader": "10.1.1",
5455
"babel-plugin-istanbul": "7.0.1",
55-
"@babel/plugin-transform-class-properties": "^7.28.6",
5656
"base64-js": "1.5.1",
5757
"browser-env": "^3.3.0",
58+
"circular-dependency-plugin": "^5.2.2",
5859
"eslint": "^9.39.4",
59-
"eslint-config-walmart": "2.2.1",
6060
"eslint-plugin-filenames": "1.3.2",
6161
"eslint-plugin-import": "2.32.0",
6262
"nyc": "18.0.0",

src/AdNode.es6

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ export default class AdNode {
2929
this._name = xmlNode.name;
3030
this._value = xmlNode.value;
3131
if (xmlNode.attributes) {
32-
this._pitch = Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%pitch`);
33-
this._speak = Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%speak`);
34-
this._id = Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_XML_URI}%%id`);
32+
this._pitch = Utils.getAttributeByFullyQualifiedName(
33+
xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%pitch`);
34+
this._speak = Utils.getAttributeByFullyQualifiedName(
35+
xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%speak`);
36+
this._id = Utils.getAttributeByFullyQualifiedName(
37+
xmlNode, `${Utils.NS_XML_URI}%%id`);
3538
}
3639
if (audioContext) {
3740
this.ac = audioContext;
@@ -146,7 +149,8 @@ export default class AdNode {
146149
}
147150

148151
get pathString() {
149-
return ((this.parent) ? `${this.parent.pathString } -> ` : "") + `${this.name}${this.idString}`;
152+
return ((this.parent) ? `${this.parent.pathString } -> ` : "")
153+
+ `${this.name}${this.idString}`;
150154
}
151155

152156
get idString() {

src/AdSourceNode.es6

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ export default class AdSourceNode extends AudioNub {
7575
Logger.log(`Audio source making progress. readyState = ${this.mediaReadyState(m)}`);
7676
});
7777
m.addEventListener("waiting", () => {
78-
Logger.log(`Audio source is waiting for more data. readyState = ${this.mediaReadyState(m)}`);
78+
Logger.log(
79+
`Audio source is waiting for more data. readyState = `
80+
+ `${this.mediaReadyState(m)}`);
7981
});
8082
}
8183
}
@@ -85,7 +87,8 @@ export default class AdSourceNode extends AudioNub {
8587
const normalEnd = super.end;
8688

8789
if (this.clipEnd) {
88-
//The duration of the clip added to the start time, or the span end, whichever comes first.
90+
// The duration of the clip added to the start time, or the span end,
91+
// whichever comes first.
8992
ret = Math.min(normalEnd, this.begin + (this.clipEnd - this.clipBegin));
9093
} else {
9194
ret = normalEnd;
@@ -103,13 +106,18 @@ export default class AdSourceNode extends AudioNub {
103106
this.input = this.mediaNode;
104107
this.gainNode.gain.value = this.gain * props.getCurrentGain();
105108
this.input.connect(this.gainNode);
106-
Logger.log(`Connected to media element source with src= ${ this.input.mediaElement.currentSrc }`);
109+
Logger.log(
110+
`Connected to media element source with src = `
111+
+ `${this.input.mediaElement.currentSrc}`);
107112

108113
this.media.play().catch(e => {
109114
Logger.log(`AdSourceNode play rejected with error: ${e}.`);
110115
});
111116
this.output.connect(this.parent.gainNode); //TODO Make formal with .input
112-
Logger.log(`Active source into: ${ this.parent.name }; src: ${ this.media.src}; from: ${ this.media.currentTime } including offset of ${offset}.`);
117+
Logger.log(
118+
`Active source into: ${ this.parent.name }; `
119+
+ `src: ${ this.media.src}; `
120+
+ `from: ${ this.media.currentTime } including offset of ${offset}.`);
113121
this.startTime = this.media.currentTime;
114122
this.isActive = true;
115123

src/AdUserControlledSourceNode.es6

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ export default class AdUserControlledSourceNode extends AdSourceNode {
2929
if (this.media && !this.isActive) {
3030
this.input = this.mediaNode;
3131
this.input.connect(this.gainNode);
32-
Logger.log(`Connected to media element source with src= ${ this.input.mediaElement.currentSrc }`);
32+
Logger.log(
33+
`Connected to media element source with `
34+
+ `src= ${ this.input.mediaElement.currentSrc }`);
3335

3436
if (this.parent) {
3537
this.output.connect(this.parent.gainNode); //TODO Make formal with .input
36-
Logger.log(`Active source into: ${ this.parent.name }; src: ${ this.media.src}; from: ${ this.media.currentTime }`);
38+
Logger.log(
39+
`Active source into: ${ this.parent.name }; `
40+
+ `src: ${ this.media.src}; `
41+
+ `from: ${ this.media.currentTime }`);
3742
} else {
3843
Logger.log("No parent to connect");
3944
}

src/AnimateNode.es6

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ export default class AnimateNode extends AdNode {
2121
constructor(parent, xmlNode, audioContext) {
2222
super(parent, xmlNode, audioContext);
2323

24-
if (Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%gain`)) {
25-
this.gains = Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%gain`).split(";").map(parseFloat);
24+
if (Utils.getAttributeByFullyQualifiedName(
25+
xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%gain`)) {
26+
this.gains = Utils.getAttributeByFullyQualifiedName(
27+
xmlNode,
28+
`${Utils.NS_TTML_AUDIO_URI}%%gain`).split(";").map(parseFloat);
2629
}
2730

28-
if (Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%pan`)) {
29-
this.pans = Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%pan`).split(";").map(parseFloat);
31+
if (Utils.getAttributeByFullyQualifiedName(
32+
xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%pan`)) {
33+
this.pans = Utils.getAttributeByFullyQualifiedName(
34+
xmlNode,
35+
`${Utils.NS_TTML_AUDIO_URI}%%pan`).split(";").map(parseFloat);
3036
}
3137
}
3238

src/AudioNub.es6

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,14 @@ export default class AudioNub extends AdNode {
7575

7676
copyAudioAttributes(xmlNode) {
7777
if (xmlNode.attributes) {
78-
this._gain = parseFloat(Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%gain`));
79-
this._pan = parseFloat(Utils.getAttributeByFullyQualifiedName(xmlNode, `${Utils.NS_TTML_AUDIO_URI}%%pan`));
78+
this._gain = parseFloat(
79+
Utils.getAttributeByFullyQualifiedName(
80+
xmlNode,
81+
`${Utils.NS_TTML_AUDIO_URI}%%gain`));
82+
this._pan = parseFloat(
83+
Utils.getAttributeByFullyQualifiedName(
84+
xmlNode,
85+
`${Utils.NS_TTML_AUDIO_URI}%%pan`));
8086
}
8187
}
8288
}

0 commit comments

Comments
 (0)