From ae32893732b309ce71ff45e87ba1f442b78ccffa Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 20 Mar 2018 09:10:48 -0700 Subject: [PATCH] Disallow trailing commas --- src/CharWidth.ts | 2 +- src/CompositionHelper.test.ts | 2 +- src/CompositionHelper.ts | 2 +- src/Terminal.ts | 2 +- src/renderer/CursorRenderLayer.ts | 6 +++--- tslint.json | 12 ++++++++++++ 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/CharWidth.ts b/src/CharWidth.ts index 512ed5f0..90673b2b 100644 --- a/src/CharWidth.ts +++ b/src/CharWidth.ts @@ -49,7 +49,7 @@ export const wcwidth = (function(opts: {nul: number, control: number}): (ucs: nu [0x206A, 0x206F], [0x20D0, 0x20EF], [0x302A, 0x302F], [0x3099, 0x309A], [0xA806, 0xA806], [0xA80B, 0xA80B], [0xA825, 0xA826], [0xFB1E, 0xFB1E], [0xFE00, 0xFE0F], - [0xFE20, 0xFE23], [0xFEFF, 0xFEFF], [0xFFF9, 0xFFFB], + [0xFE20, 0xFE23], [0xFEFF, 0xFEFF], [0xFFF9, 0xFFFB] ]; const COMBINING_HIGH = [ [0x10A01, 0x10A03], [0x10A05, 0x10A06], [0x10A0C, 0x10A0F], diff --git a/src/CompositionHelper.test.ts b/src/CompositionHelper.test.ts index 09a59f72..02231723 100644 --- a/src/CompositionHelper.test.ts +++ b/src/CompositionHelper.test.ts @@ -17,7 +17,7 @@ describe('CompositionHelper', () => { compositionView = { classList: { add: () => {}, - remove: () => {}, + remove: () => {} }, getBoundingClientRect: () => { return { width: 0 }; diff --git a/src/CompositionHelper.ts b/src/CompositionHelper.ts index 387d3f8f..389cb782 100644 --- a/src/CompositionHelper.ts +++ b/src/CompositionHelper.ts @@ -132,7 +132,7 @@ export class CompositionHelper { // fire before the setTimeout executes. const currentCompositionPosition = { start: this._compositionPosition.start, - end: this._compositionPosition.end, + end: this._compositionPosition.end }; // Since composition* events happen before the changes take place in the textarea on most diff --git a/src/Terminal.ts b/src/Terminal.ts index a0d6ed6f..dc71f477 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -118,7 +118,7 @@ const DEFAULT_OPTIONS: ITerminalOptions = { allowTransparency: false, tabStopWidth: 8, theme: null, - rightClickSelectsWord: Browser.isMac, + rightClickSelectsWord: Browser.isMac // programFeatures: false, // focusKeys: false, }; diff --git a/src/renderer/CursorRenderLayer.ts b/src/renderer/CursorRenderLayer.ts index bfd215ad..c63c2f14 100644 --- a/src/renderer/CursorRenderLayer.ts +++ b/src/renderer/CursorRenderLayer.ts @@ -33,7 +33,7 @@ export class CursorRenderLayer extends BaseRenderLayer { y: null, isFocused: null, style: null, - width: null, + width: null }; this._cursorRenderers = { 'bar': this._renderBarCursor.bind(this), @@ -51,7 +51,7 @@ export class CursorRenderLayer extends BaseRenderLayer { y: null, isFocused: null, style: null, - width: null, + width: null }; } @@ -183,7 +183,7 @@ export class CursorRenderLayer extends BaseRenderLayer { y: null, isFocused: null, style: null, - width: null, + width: null }; } } diff --git a/tslint.json b/tslint.json index 37ede7fe..d42fda71 100644 --- a/tslint.json +++ b/tslint.json @@ -43,6 +43,18 @@ true, "always" ], + "trailing-comma": [ + true, + { + "multiline": { + "objects": "never", + "arrays": "never", + "functions": "never", + "typeLiterals": "ignore" + }, + "esSpecCompliant": true + } + ], "triple-equals": [ true, "allow-null-check"