Skip to content

Commit efe70aa

Browse files
tomdaleaciccarello
authored andcommitted
Upgrade tslint to 5.9.1 (#683)
* Fix max-line-length tslint config The max-line-length rule was not being enforced because of an invalid configuration value. In order to supply configuration information other than "on" or "off", the rule must be an array value. While this was silently failing in older versions of tslint, the upgrade to tslint 5.9.0 causes this malformed value to fail with an exception. After fixing the configuration of this rule, many lines of the existing codebase were in violation. Rather than reformat a bunch of files, I bumped the maximum line length from 120 to 170, and reformatted a handful of outlier lines that were even longer than this. * Bump minimum tslint version to 5.9.1
1 parent 32bf528 commit efe70aa

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"grunt-tslint": "^5.0.1",
6262
"istanbul": "^0.4.1",
6363
"mocha": "^4.0.0",
64-
"tslint": "^5.1.0"
64+
"tslint": "^5.9.1"
6565
},
6666
"files": [
6767
"bin",

src/lib/converter/types/array.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ export class ArrayConverter extends ConverterTypeComponent implements TypeConver
1818
*/
1919
supportsType(context: Context, type: ts.TypeReference): boolean {
2020
// Is there a better way to detect the {"type":"reference","name":"Array","typeArguments":{...}} types that are in fact arrays?
21-
return !!(type.flags & ts.TypeFlags.Object) && !!type.symbol && type.symbol.name === 'Array' && !type.symbol.parent && !!type.typeArguments && type.typeArguments.length === 1;
21+
return !!(type.flags & ts.TypeFlags.Object)
22+
&& !!type.symbol
23+
&& type.symbol.name === 'Array'
24+
&& !type.symbol.parent
25+
&& !!type.typeArguments
26+
&& type.typeArguments.length === 1;
2227
}
2328

2429
/**

src/lib/utils/events.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ interface EventIteratee<T, U> {
4545
(events: U, name: string, callback: Function, options: T): U;
4646
}
4747

48+
interface EventTriggerer {
49+
(events: EventHandler[], args: any[]): void;
50+
}
51+
4852
interface OnApiOptions {
4953
context: any;
5054
ctx: any;
@@ -199,7 +203,7 @@ function onceMap(map: EventMap, name: string, callback: EventCallback, offer: Fu
199203
/**
200204
* Handles triggering the appropriate event callbacks.
201205
*/
202-
function triggerApi(objEvents: EventHandlers, name: string, callback: Function, args: any[], triggerer: {(events: EventHandler[], args: any[]): void} = triggerEvents): EventHandlers {
206+
function triggerApi(objEvents: EventHandlers, name: string, callback: Function, args: any[], triggerer: EventTriggerer = triggerEvents): EventHandlers {
203207
if (objEvents) {
204208
const events = objEvents[name];
205209
let allEvents = objEvents['all'];

tslint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"interface-name": [ true, "never-prefix" ],
1212
"jsdoc-format": true,
1313
"label-position": true,
14-
"max-line-length": 120,
14+
"max-line-length": [true, 170],
1515
"member-access": false,
1616
"member-ordering": false,
1717
"no-any": false,

0 commit comments

Comments
 (0)