Skip to content

Commit df80abf

Browse files
authored
Merge pull request #1542 from mathjax/update/packages
Update packages and linting
2 parents d8ab554 + 90c6648 commit df80abf

12 files changed

Lines changed: 878 additions & 1030 deletions

File tree

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,26 @@
148148
"build-all": "build() { pnpm -s build-mjs $1; echo ; pnpm -s build-cjs $1; }; build"
149149
},
150150
"devDependencies": {
151-
"@eslint/js": "^9.39.2",
151+
"@eslint/js": "^10.0.1",
152152
"@xmldom/xmldom": "^0.9.10",
153153
"copyfiles": "^2.4.1",
154154
"diff": "^9.0.0",
155-
"eslint": "^9.39.2",
155+
"eslint": "^10.8.0",
156156
"eslint-formatter-unix": "^9.0.1",
157-
"eslint-plugin-jsdoc": "^62.5.5",
158-
"eslint-plugin-prettier": "^5.5.5",
157+
"eslint-plugin-jsdoc": "^63.3.3",
158+
"eslint-plugin-prettier": "^5.5.6",
159159
"husky": "^9.1.7",
160-
"lint-staged": "^16.2.7",
161-
"prettier": "^3.8.3",
160+
"lint-staged": "^17.3.0",
161+
"prettier": "^3.9.6",
162162
"rimraf": "^6.1.3",
163163
"string-replace-loader": "^3.3.0",
164-
"terser-webpack-plugin": "^5.5.0",
165-
"typedoc": "^0.28.19",
164+
"terser-webpack-plugin": "^5.6.1",
165+
"typedoc": "^0.28.20",
166166
"typescript": "^5.9.3",
167-
"typescript-eslint": "^8.56.0",
167+
"typescript-eslint": "^8.66.0",
168168
"typescript-tools": "^0.3.1",
169-
"webpack": "^5.106.2",
170-
"webpack-cli": "^7.0.2",
169+
"webpack": "^5.109.2",
170+
"webpack-cli": "^7.2.2",
171171
"wicked-good-xpath": "^1.3.0",
172172
"xslt3": "^2.7.0"
173173
},

pnpm-lock.yaml

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

testsuite/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"#helpers": ["./js/src/index.js"]
1313
},
1414
"isolatedModules": true,
15+
"skipLibCheck": true,
1516
"lib": ["DOM", "es2022"]
1617
},
1718
"include": ["./tests/**/*.ts", "./src/*.ts"]

ts/core/MmlTree/MmlNodes/mo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,16 +346,16 @@ export class MmlMo extends AbstractMmlTokenNode {
346346
*/
347347
public adjustTeXclass(prev: MmlNode): MmlNode {
348348
const texClass = this.texClass;
349-
let prevClass = this.prevClass;
350349
if (texClass === TEXCLASS.NONE) {
351350
return prev;
352351
}
352+
let prevClass;
353353
if (prev) {
354354
if (
355355
prev.getProperty('autoOP') &&
356356
(texClass === TEXCLASS.BIN || texClass === TEXCLASS.REL)
357357
) {
358-
prevClass = prev.texClass = TEXCLASS.ORD;
358+
prev.texClass = TEXCLASS.ORD;
359359
}
360360
prevClass = this.prevClass = prev.texClass || TEXCLASS.ORD;
361361
this.prevLevel = this.attributes.getInherited('scriptlevel') as number;

ts/handlers/html/HTMLDomStrings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export class HTMLDomStrings<N, T, D> {
240240
const cname = this.adaptor.getAttribute(node, 'class') || '';
241241
const tname = this.adaptor.kind(node) || '';
242242
const process = this.processHtmlClass.exec(cname);
243-
let next = node as N | T;
243+
let next;
244244
if (
245245
this.adaptor.firstChild(node) &&
246246
!this.adaptor.getAttribute(node, 'data-MJX') &&

ts/input/tex/ParseUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function readKeyval(text: string, l3keys: boolean = false): EnvList {
112112
[key, end, rest] = readValue(rest, ['=', ','], l3keys, dropBrace);
113113
dropBrace = false;
114114
if (end === '=') {
115-
[val, end, rest] = readValue(rest, [','], l3keys);
115+
[val, , rest] = readValue(rest, [','], l3keys);
116116
val = val === 'false' || val === 'true' ? JSON.parse(val) : val;
117117
options[key] = val;
118118
} else if (key) {

ts/input/tex/ams/AmsItems.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export class MultlineItem extends ArrayItem {
9393
super.EndTable();
9494
if (this.table.length) {
9595
const m = this.table.length - 1;
96-
let label = -1;
9796
if (
9897
!NodeUtil.getAttribute(
9998
NodeUtil.getChildren(this.table[0])[0],
@@ -120,7 +119,7 @@ export class MultlineItem extends ArrayItem {
120119
}
121120
const tag = this.factory.configuration.tags.getTag();
122121
if (tag) {
123-
label =
122+
const label =
124123
this.arraydef.side === TexConstant.Align.LEFT
125124
? 0
126125
: this.table.length - 1;

ts/input/tex/newcommand/NewcommandMethods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ const NewcommandMethods: { [key: string]: ParseMethod } = {
296296
args.push(parser.GetArgument(`\\begin{${name}}`));
297297
}
298298
bdef = ParseUtil.substituteArgs(parser, args, bdef);
299-
edef = ParseUtil.substituteArgs(parser, [], edef); // no args, but get errors for #n in edef
299+
ParseUtil.substituteArgs(parser, [], edef); // no args, but get errors for #n in edef
300300
}
301301
parser.string = ParseUtil.addArgs(
302302
parser,

ts/input/tex/newcommand/NewcommandUtil.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ export const NewcommandUtil = {
119119
*/
120120
GetTemplate(parser: TexParser, cmd: string, cs: string): number | string[] {
121121
// @test Def Double Let, Def ReDef, Def Let
122-
let c = parser.GetNext();
122+
parser.GetNext(); // Move past the first non-whitespace character.
123123
const params: string[] = [];
124124
let n = 0;
125125
let i = parser.i;
126126
while (parser.i < parser.string.length) {
127-
c = parser.GetNext();
127+
let c = parser.GetNext();
128128
if (c === '#') {
129129
// @test Def ReDef, Def Let, Def Optional Brace
130130
if (i !== parser.i) {

ts/input/tex/physics/PhysicsMethods.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,11 @@ function vectorApplication(
137137
if (!right) {
138138
return;
139139
}
140-
let lfence = '',
141-
rfence = '',
142-
arg = '';
143140
const enlarge = fences.includes(left);
144141
if (left === '{') {
145-
arg = parser.GetArgument(name);
146-
lfence = enlarge ? '\\left\\{' : '';
147-
rfence = enlarge ? '\\right\\}' : '';
142+
const arg = parser.GetArgument(name);
143+
const lfence = enlarge ? '\\left\\{' : '';
144+
const rfence = enlarge ? '\\right\\}' : '';
148145
const macro = `${lfence} ${arg} ${rfence}`;
149146
parser.string = macro + parser.string.slice(parser.i);
150147
parser.i = 0;
@@ -681,7 +678,7 @@ const PhysicsMethods: { [key: string]: ParseMethod } = {
681678
parser.i = saveI;
682679
}
683680
}
684-
let macro = '';
681+
let macro;
685682
if (hasKet) {
686683
macro =
687684
starBra || starKet
@@ -727,7 +724,7 @@ const PhysicsMethods: { [key: string]: ParseMethod } = {
727724
if (parser.GetNext() === '{') {
728725
ket = parser.GetArgument(name, true);
729726
}
730-
let macro = '';
727+
let macro;
731728
if (ket == null) {
732729
macro = star
733730
? `\\langle{${bra}}\\vert{${bra}}\\rangle`
@@ -755,7 +752,7 @@ const PhysicsMethods: { [key: string]: ParseMethod } = {
755752
if (parser.GetNext() === '{') {
756753
bra = parser.GetArgument(name, true);
757754
}
758-
let macro = '';
755+
let macro;
759756
if (bra == null) {
760757
macro = star
761758
? `\\vert{${ket}}\\rangle\\!\\langle{${ket}}\\vert`
@@ -928,7 +925,7 @@ const PhysicsMethods: { [key: string]: ParseMethod } = {
928925
parser.i = 0;
929926
return;
930927
}
931-
let matrix = '';
928+
let matrix;
932929
if (n === 1 && m === 1) {
933930
// Case 1: n=m=1, no index.
934931
matrix = arg1;
@@ -1010,7 +1007,7 @@ const PhysicsMethods: { [key: string]: ParseMethod } = {
10101007
const endI = parser.i;
10111008
parser.i = startI + 1;
10121009
const elements = [];
1013-
let element = '';
1010+
let element;
10141011
let currentI = parser.i;
10151012
while (currentI < endI) {
10161013
try {

0 commit comments

Comments
 (0)