Skip to content
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

add tslint and fix errors #9

Merged
merged 5 commits into from
Nov 5, 2019
Merged
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"cross-env": "^5.2.0",
"mocha": "^6.1.4",
"ts-node": "^8.3.0",
"tslint": "^6.0.0-beta0",
"typescript": "^3.5.3"
}
}
14 changes: 13 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
export default interface Config {
name: string;
url: string;
charset: string;
origin: string;
protocol: string;
timeout: number;
blobSize: number;
preventIdleTimeout: number;
terminal: {
columns: number;
rows: number;
};
[key: string]: any;
};
}
8 changes: 4 additions & 4 deletions src/sites/ptt/Article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export class Article {
}

static fromLine(line: string): Article {
let article = new Article();
article.sn =+substrWidth('dbcs', line, 1, 7).trim();
const article = new Article();
article.sn = +substrWidth('dbcs', line, 1, 7).trim();
article.push = substrWidth('dbcs', line, 9, 2).trim();
article.date = substrWidth('dbcs', line, 11, 5).trim();
article.author = substrWidth('dbcs', line, 17, 12).trim();
Expand All @@ -27,7 +27,7 @@ export class Article {
return article;
}

get content(): ReadonlyArray<string> {
get content(): ReadonlyArray<string> {
return this._content;
}
set content(data: ReadonlyArray<string>) {
Expand All @@ -42,6 +42,6 @@ export class Article {
set lines(data: ReadonlyArray<string>) {
this.content = data;
}
};
}

export default Article;
10 changes: 5 additions & 5 deletions src/sites/ptt/Board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ export class Board {
title: string;
users: string;
admin: string;
folder: boolean = false;
divider: boolean = false;
folder = false;
divider = false;

constructor() {
}

static fromLine(line: string): Board {
let board = new Board();
board.bn =+substrWidth('dbcs', line, 3, 4).trim();
const board = new Board();
board.bn = +substrWidth('dbcs', line, 3, 4).trim();
board.read = substrWidth('dbcs', line, 8, 2).trim() === '';
board.boardname = substrWidth('dbcs', line, 10, 12).trim();
board.category = substrWidth('dbcs', line, 23, 4).trim();
Expand All @@ -42,4 +42,4 @@ export class Board {
return board;
}

};
}
Loading