package upgrades & linter fixes

This commit is contained in:
Jörg Breitbart
2026-05-09 17:42:49 +02:00
parent 6ba731d73b
commit dc1ae4514b
36 changed files with 2804 additions and 2389 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
if (!this._themeService) return;
for (const req of event) {
let acc: 'foreground' | 'background' | 'cursor' | 'ansi';
let ident = '';
let ident: string;
switch (req.index) {
case SpecialColorIndex.FOREGROUND: // OSC 10 | 110
acc = 'foreground';
+1 -1
View File
@@ -125,7 +125,7 @@ function formatError(input: string, output: string, expected: string): string {
// simple debug output of terminal cells
function terminalToString(term: CoreBrowserTerminal): string {
let result = '';
let lineText = '';
let lineText: string;
for (let line = term.buffer.ybase; line < term.buffer.ybase + term.rows; line++) {
lineText = term.buffer.lines.get(line)!.translateToString(true);
// rtrim empty cells as xterm does
@@ -90,14 +90,14 @@ export class DomRendererRowFactory {
let charElement: HTMLSpanElement | undefined;
let cellAmount = 0;
let text = '';
let i = 0;
let i;
let oldBg = 0;
let oldFg = 0;
let oldExt = 0;
let oldLinkHover: number | boolean = false;
let oldSpacing = 0;
let oldIsInSelection: boolean = false;
let spacing = 0;
let spacing;
let skipJoinedCheckUntilX = 0;
const classes: string[] = [];
@@ -231,6 +231,7 @@ export class DomRendererRowFactory {
}
charElement = this._document.createElement('span');
cellAmount = 0;
// eslint-disable-next-line no-useless-assignment
text = '';
}
}
+1 -1
View File
@@ -110,7 +110,7 @@ export class WidthCache implements IDisposable {
* `variant` denotes the font variant to be used.
*/
public get(c: string, bold: boolean | number, italic: boolean | number): number {
let cp = 0;
let cp: number;
if (!bold && !italic && c.length === 1 && (cp = c.charCodeAt(0)) < WidthCacheSettings.FLAT_SIZE) {
if (this._flat[cp] !== WidthCacheSettings.FLAT_UNSET) {
return this._flat[cp];
+1 -1
View File
@@ -367,7 +367,7 @@ export class Gesture extends Disposable {
private _dispatchEvent(event: IGestureEvent): void {
if (event.type === EventType.TAP) {
const currentTime = (new Date()).getTime();
let setTapCount = 0;
let setTapCount;
if (currentTime - this._lastSetTapCountTime > Gesture._clearTapCountTime) {
setTapCount = 1;
} else {
@@ -285,7 +285,7 @@ function substringJoiner(substring: string): (sequence: string) => [number, numb
return (sequence: string): [number, number][] => {
const ranges: [number, number][] = [];
let searchIndex = 0;
let matchIndex = -1;
let matchIndex;
while ((matchIndex = sequence.indexOf(substring, searchIndex)) !== -1) {
const matchEndIndex = matchIndex + substring.length;
+4 -4
View File
@@ -919,10 +919,10 @@ export class SelectionService extends Disposable implements ISelectionService {
// Calculate the start _column_, converting the the string indexes back to
// column coordinates.
let start =
startIndex // The index of the selection's start char in the line string
+ charOffset // The difference between the initial char's column and index
- leftWideCharCount // The number of wide chars left of the initial char
+ leftLongCharOffset; // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)
startIndex // The index of the selection's start char in the line string
+ charOffset // The difference between the initial char's column and index
- leftWideCharCount // The number of wide chars left of the initial char
+ leftLongCharOffset; // The number of additional chars left of the initial char added by columns with strings longer than 1 (emojis)
// Calculate the length in _columns_, converting the the string indexes back
// to column coordinates.
+2 -2
View File
@@ -74,10 +74,10 @@ abstract class TaskQueue implements ITaskQueue {
private _process(deadline: ITaskDeadline): void {
this._idleCallback = undefined;
let taskDuration = 0;
let taskDuration: number;
let longestTask = 0;
let lastDeadlineRemaining = deadline.timeRemaining();
let deadlineRemaining = 0;
let deadlineRemaining: number;
while (this._i < this._tasks.length) {
taskDuration = performance.now();
if (!this._tasks[this._i]()) {
+3 -6
View File
@@ -98,8 +98,7 @@ CHARSETS['4'] = {
* ESC (C or ESC (5
* Reference: http://vt100.net/docs/vt220-rm/table2-7.html
*/
CHARSETS['C'] =
CHARSETS['5'] = {
CHARSETS['C'] = CHARSETS['5'] = {
'[': 'Ä',
'\\': 'Ö',
']': 'Å',
@@ -185,8 +184,7 @@ CHARSETS['Y'] = {
* ESC (E or ESC (6
* Reference: http://vt100.net/docs/vt220-rm/table2-12.html
*/
CHARSETS['E'] =
CHARSETS['6'] = {
CHARSETS['E'] = CHARSETS['6'] = {
'@': 'Ä',
'[': 'Æ',
'\\': 'Ø',
@@ -220,8 +218,7 @@ CHARSETS['Z'] = {
* ESC (H or ESC (7
* Reference: http://vt100.net/docs/vt220-rm/table2-14.html
*/
CHARSETS['H'] =
CHARSETS['7'] = {
CHARSETS['H'] = CHARSETS['7'] = {
'@': 'É',
'[': 'Ä',
'\\': 'Ö',
+1 -1
View File
@@ -148,7 +148,7 @@ export class Utf8ToUtf32 {
let byte2: number;
let byte3: number;
let byte4: number;
let codepoint = 0;
let codepoint;
let startPos = 0;
// handle leftover bytes
+2 -2
View File
@@ -572,8 +572,8 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
* ```
*/
public parse(data: Uint32Array, length: number, promiseResult?: boolean): void | Promise<boolean> {
let code = 0;
let transition = 0;
let code: number;
let transition: number;
let start = 0;
let handlerResult: void | boolean | Promise<boolean>;
+4 -4
View File
@@ -72,10 +72,10 @@ export class DecorationService extends Disposable implements IDecorationService
}
public *getDecorationsAtCell(x: number, line: number, layer?: 'bottom' | 'top'): IterableIterator<IInternalDecoration> {
let xmin = 0;
let xmax = 0;
let ymin = 0;
let ymax = 0;
let xmin;
let xmax;
let ymin;
let ymax;
for (const d of this._decorations.values()) {
ymin = d.marker.line;
ymax = ymin + (d.options.height ?? 1);
+1 -2
View File
@@ -4,7 +4,6 @@
"composite": true,
"strict": true,
"declarationMap": true,
"experimentalDecorators": true,
"downlevelIteration": true
"experimentalDecorators": true
}
}