Skip to content

Commit b93cf82

Browse files
lint
1 parent 4cc0361 commit b93cf82

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

addons/xterm-addon-ligatures/src/index.test.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@ describe('xterm-addon-ligatures', () => {
1616

1717
before(() => {
1818
sinon.stub(fontFinder, 'list').returns(Promise.resolve({
19+
// eslint-disable-next-line @typescript-eslint/naming-convention
1920
'Fira Code': [{
2021
path: path.join(__dirname, '../fonts/firaCode.otf'),
2122
style: fontFinder.Style.Regular,
2223
type: fontFinder.Type.Monospace,
2324
weight: 400
2425
}],
26+
// eslint-disable-next-line @typescript-eslint/naming-convention
2527
'Iosevka': [{
2628
path: path.join(__dirname, '../fonts/iosevka.ttf'),
2729
style: fontFinder.Style.Regular,
2830
type: fontFinder.Type.Monospace,
2931
weight: 400
3032
}],
33+
// eslint-disable-next-line @typescript-eslint/naming-convention
3134
'Nonexistant Font': [{
3235
path: path.join(__dirname, '../fonts/nonexistant.ttf'),
3336
style: fontFinder.Style.Regular,
@@ -185,32 +188,32 @@ describe('xterm-addon-ligatures', () => {
185188
});
186189

187190
class MockTerminal {
188-
static applyAddon(addon: any): void {
191+
public static applyAddon(addon: any): void {
189192
addon.apply(MockTerminal);
190193
}
191194

192-
private _options: { [name: string]: string | number; } = {
195+
private _options: { [name: string]: string | number } = {
193196
fontFamily: 'Fira Code, monospace',
194197
rows: 50
195198
};
196-
joiner?: (text: string) => [number, number][];
197-
refresh: (start: number, end: number) => void;
199+
public joiner?: (text: string) => [number, number][];
200+
public refresh: (start: number, end: number) => void;
198201

199202
constructor(onRefresh: (start: number, end: number) => void) {
200203
this.refresh = onRefresh;
201204
}
202205

203-
registerCharacterJoiner(handler: (text: string) => [number, number][]): number {
206+
public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {
204207
this.joiner = handler;
205208
return 1;
206209
}
207-
deregisterCharacterJoiner(id: number): void {
210+
public deregisterCharacterJoiner(id: number): void {
208211
this.joiner = undefined;
209212
}
210-
setOption(name: string, value: string | number): void {
213+
public setOption(name: string, value: string | number): void {
211214
this._options[name] = value;
212215
}
213-
getOption(name: string): string | number {
216+
public getOption(name: string): string | number {
214217
return this._options[name];
215218
}
216219
}

addons/xterm-addon-ligatures/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ export function enableLigatures(term: Terminal): void {
7070
return font.findLigatureRanges(text).map<[number, number]>(
7171
range => [range[0], range[1]]
7272
);
73-
} else if (loadingState === LoadingState.FAILED) {
73+
}
74+
if (loadingState === LoadingState.FAILED) {
7475
throw loadError || new Error('Failure while loading font');
7576
}
7677

addons/xterm-addon-ligatures/src/parse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,8 @@ function parseUnicode(context: IParseContext): string {
150150
// The first whitespace character after a unicode escape indicates the end
151151
// of the escape and is swallowed.
152152
return unicodeToString(str);
153-
} else if (str.length >= 6 || !/[0-9a-fA-F]/.test(char)) {
153+
}
154+
if (str.length >= 6 || !/[0-9a-fA-F]/.test(char)) {
154155
// If the next character is not a valid hex digit or we have reached the
155156
// maximum of 6 digits in the escape, terminate the escape.
156157
context.offset--;

0 commit comments

Comments
 (0)