Enforce const enums

Fixes #1408
This commit is contained in:
Daniel Imms
2018-04-23 17:35:41 -07:00
parent 45b4429712
commit fcde7be62a
7 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import { IDisposable } from 'xterm';
const MAX_ROWS_TO_READ = 20;
enum BoundaryPosition {
const enum BoundaryPosition {
TOP,
BOTTOM
}
+1 -1
View File
@@ -150,7 +150,7 @@ csiStateHandler['s'] = (handler, params) => handler.saveCursor(params);
csiStateHandler['u'] = (handler, params) => handler.restoreCursor(params);
csiStateHandler[C0.CAN] = (handler, params, prefix, postfix, parser) => parser.setState(ParserState.NORMAL);
export enum ParserState {
export const enum ParserState {
NORMAL = 0,
ESCAPED = 1,
CSI_PARAM = 2,
+1 -1
View File
@@ -54,7 +54,7 @@ interface IWordPosition {
/**
* A selection mode, this drives how the selection behaves on mouse move.
*/
enum SelectionMode {
const enum SelectionMode {
NORMAL,
WORD,
LINE
+1 -1
View File
@@ -17,7 +17,7 @@ export type LineData = CharData[];
export type LinkMatcherHandler = (event: MouseEvent, uri: string) => void;
export type LinkMatcherValidationCallback = (uri: string, callback: (isValid: boolean) => void) => void;
export enum LinkHoverEventTypes {
export const enum LinkHoverEventTypes {
HOVER = 'linkhover',
TOOLTIP = 'linktooltip',
LEAVE = 'linkleave'
+1 -1
View File
@@ -6,7 +6,7 @@
import { ITerminal, ICircularList, LineData } from '../Types';
import { C0 } from '../EscapeSequences';
enum Direction {
const enum Direction {
UP = 'A',
DOWN = 'B',
RIGHT = 'C',
+1 -1
View File
@@ -10,7 +10,7 @@ import { IColorSet } from '../shared/Types';
/**
* Flags used to render terminal text properly.
*/
export enum FLAGS {
export const enum FLAGS {
BOLD = 1,
UNDERLINE = 2,
BLINK = 4,
+3
View File
@@ -92,6 +92,9 @@
"naming-convention": [
true,
{"type": "property", "modifiers": ["public", "static", "const"], "format": "UPPER_CASE"}
],
"prefer-const-enum": [
true
]
}
}