Skip to content

Upgrade to ts 2.6.2 #681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"name": "Sebastian Lenz",
"url": "http://www.sebastian-lenz.de/"
},
"contributors": [
{
"name": "Andre Loker"
}
],
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,7 +51,7 @@
"progress": "^2.0.0",
"shelljs": "^0.7.0",
"typedoc-default-themes": "^0.5.0",
"typescript": "2.5.3"
"typescript": "2.6.2"
},
"devDependencies": {
"@types/mocha": "^2.2.39",
Expand Down
4 changes: 2 additions & 2 deletions src/lib/converter/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ConverterResult {
/**
* An array containing all errors generated by the TypeScript compiler.
*/
errors: ts.Diagnostic[];
errors: ReadonlyArray<ts.Diagnostic>;

/**
* The resulting project reflection.
Expand Down Expand Up @@ -351,7 +351,7 @@ export class Converter extends ChildableComponent<Application, ConverterComponen
* @param context The context object describing the current state the converter is in.
* @returns An array containing all errors generated by the TypeScript compiler.
*/
private compile(context: Context): ts.Diagnostic[] {
private compile(context: Context): ReadonlyArray<ts.Diagnostic> {
const program = context.program;

program.getSourceFiles().forEach((sourceFile) => {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/converter/plugins/PackagePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { Option } from '../../utils/component';
export class PackagePlugin extends ConverterComponent {
@Option({
name: 'readme',
help: 'Path to the readme file that should be displayed on the index page. Pass `none` to disable the index page and start the documentation on the globals page.'
help: 'Path to the readme file that should be displayed on the index page. Pass `none` to disable the index ' +
'page and start the documentation on the globals page.'
})
readme: string;

Expand Down
6 changes: 5 additions & 1 deletion src/lib/converter/types/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export class ArrayConverter extends ConverterTypeComponent implements TypeConver
*/
supportsType(context: Context, type: ts.TypeReference): boolean {
// Is there a better way to detect the {"type":"reference","name":"Array","typeArguments":{...}} types that are in fact arrays?
return !!(type.flags & ts.TypeFlags.Object) && !!type.symbol && type.symbol.name === 'Array' && !type.symbol.parent && !!type.typeArguments && type.typeArguments.length === 1;
return !!(type.flags & ts.TypeFlags.Object)
&& !!type.symbol && type.symbol.name === 'Array'
&& !type.symbol.parent
&& !!type.typeArguments
&& type.typeArguments.length === 1;
}

/**
Expand Down
14 changes: 13 additions & 1 deletion src/lib/serialization/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,19 @@ export interface TypeObject {
/**
* The type name identifier.
*/
type: 'void' | 'array' | 'intersection' | 'intrinsic' | 'reference' | 'reflection' | 'stringLiteral' | 'tuple' | 'typeParameter' | 'union' | 'unknown' | string;
type:
| 'void'
| 'array'
| 'intersection'
| 'intrinsic'
| 'reference'
| 'reflection'
| 'stringLiteral'
| 'tuple'
| 'typeParameter'
| 'union'
| 'unknown'
| string;

// array
/**
Expand Down
6 changes: 5 additions & 1 deletion src/lib/utils/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ function onceMap(map: EventMap, name: string, callback: EventCallback, offer: Fu
/**
* Handles triggering the appropriate event callbacks.
*/
function triggerApi(objEvents: EventHandlers, name: string, callback: Function, args: any[], triggerer: {(events: EventHandler[], args: any[]): void} = triggerEvents): EventHandlers {
function triggerApi(objEvents: EventHandlers,
name: string,
callback: Function,
args: any[],
triggerer: {(events: EventHandler[], args: any[]): void} = triggerEvents): EventHandlers {
if (objEvents) {
const events = objEvents[name];
let allEvents = objEvents['all'];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/loggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class Logger {
*
* @param diagnostics The TypeScript messages that should be logged.
*/
public diagnostics(diagnostics: ts.Diagnostic[]) {
public diagnostics(diagnostics: ReadonlyArray<ts.Diagnostic>) {
diagnostics.forEach((diagnostic) => {
this.diagnostic(diagnostic);
});
Expand Down
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"interface-name": [ true, "never-prefix" ],
"jsdoc-format": true,
"label-position": true,
"max-line-length": 120,
"max-line-length": [true, 160],
"member-access": false,
"member-ordering": false,
"no-any": false,
Expand Down