Skip to content

Commit

Permalink
Enforce core layering and enable strict
Browse files Browse the repository at this point in the history
Part of xtermjs#1507
Part of xtermjs#1319
  • Loading branch information
Tyriar committed Sep 18, 2018
1 parent d1deca2 commit fb0b73a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@
"webpack": "gulp webpack",
"watch": "concurrently --kill-others-on-fail --names \"lib,css\" \"tsc -w\" \"gulp watch-css\"",
"watch-addons": "concurrently --kill-others-on-fail --names \"attach,fit,fullscreen,search,terminado,webLinks,winptyCompat,zmodem\" \"tsc -w -p ./src/addons/attach\" \"tsc -w -p ./src/addons/fit\" \"tsc -w -p ./src/addons/fullscreen\" \"tsc -w -p ./src/addons/search\" \"tsc -w -p ./src/addons/terminado\" \"tsc -w -p ./src/addons/webLinks\" \"tsc -w -p ./src/addons/winptyCompat\" \"tsc -w -p ./src/addons/zmodem\"",
"layering": "tsc -p ./src/common"
"layering": "concurrently --kill-others-on-fail --names \"common,core\" \"tsc -p ./src/common\" \"tsc -p ./src/core\""
}
}
1 change: 1 addition & 0 deletions src/common/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"rootDir": ".",
"noEmit": true,
"strict": true,
"pretty": true,
"types": [
"../../node_modules/@types/mocha",
"../../"
Expand Down
4 changes: 2 additions & 2 deletions src/core/data/Charsets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { ICharset } from '../Types';
* to be represented within the terminal with only 8-bit encoding. See ISO 2022
* for a discussion on character sets. Only VT100 character sets are supported.
*/
export const CHARSETS: { [key: string]: ICharset } = {};
export const CHARSETS: { [key: string]: ICharset | null } = {};

/**
* The default character set, US.
*/
export const DEFAULT_CHARSET: ICharset = CHARSETS['B'];
export const DEFAULT_CHARSET: ICharset | null = CHARSETS['B'];

/**
* DEC Special Character and Line Drawing Set.
Expand Down
5 changes: 3 additions & 2 deletions src/core/input/Keyboard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { assert } from 'chai';
import { evaluateKeyboardEvent } from './Keyboard';
import { IKeyboardResult } from '../Types';
import { IKeyboardEvent } from '../../common/Types';

/**
* A helper function for testing which allows passing in a partial event and defaults will be filled
Expand All @@ -20,12 +21,12 @@ function testEvaluateKeyboardEvent(partialEvent: {
isMac?: boolean;
macOptionIsMeta?: boolean;
} = {}): IKeyboardResult {
const event = {
const event: IKeyboardEvent = {
altKey: partialEvent.altKey || false,
ctrlKey: partialEvent.ctrlKey || false,
shiftKey: partialEvent.shiftKey || false,
metaKey: partialEvent.metaKey || false,
keyCode: partialEvent.keyCode !== undefined ? partialEvent.keyCode : undefined,
keyCode: partialEvent.keyCode !== undefined ? partialEvent.keyCode : 0,
key: partialEvent.key || '',
type: partialEvent.type || ''
};
Expand Down
20 changes: 20 additions & 0 deletions src/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"es5"
],
"rootDir": ".",
"noEmit": true,
"strict": true,
"pretty": true,
"types": [
"../../node_modules/@types/mocha",
"../../"
]
},
"include": [
"./**/*",
"../common/**/*"
]
}

0 comments on commit fb0b73a

Please sign in to comment.