Skip to content

Commit

Permalink
use T[] style for array
Browse files Browse the repository at this point in the history
  • Loading branch information
maxfie1d committed Apr 5, 2017
1 parent 508f91e commit a213002
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/gr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface GRInfo {
}

function createDocumentation(type: GRType): string {
let s = "汎用レジスタ。"
let s = "汎用レジスタ。";
if (type & GRType.UsedAsIndexRegister) {
s += "指標レジスタとして使用できます。";
} else {
Expand All @@ -78,7 +78,7 @@ function createGRInfo(gr: GR, type: GRType): GRInfo {
};
}

export const grsInfo: Array<GRInfo> = [
export const grsInfo: GRInfo[] = [
createGRInfo(GR.GR0, GRType.None),
createGRInfo(GR.GR1, GRType.UsedAsIndexRegister),
createGRInfo(GR.GR2, GRType.UsedAsIndexRegister),
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/jisx0201.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function convertToCharCode(ch: string): number {
return code;
}

export function convertToCharCodes(s: string): Array<number> {
export function convertToCharCodes(s: string): number[] {
const r = [];
for (const c of s) {
r.push(convertToCharCode(c));
Expand Down Expand Up @@ -45,7 +45,7 @@ export function convertToChar(charCode: number): string {
* 文字コード列から文字列に変換します
* @param charCodes 文字コードの配列
*/
export function convertToString(charCodes: Array<number>): string {
export function convertToString(charCodes: number[]): string {
return charCodes.map(charCode => convertToChar(charCode)).join("");
}

Expand Down
2 changes: 1 addition & 1 deletion src/instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function createInstructionInfo(inst: string, type: ArgumentType, code: number) {
return { instructionName: inst, argumentType: type, code: code };
}

export const instructionsInfo: Array<InstructionInfo> = [
export const instructionsInfo: InstructionInfo[] = [
// アセンブラ命令
{ instructionName: "START", argumentType: ArgumentType.label_START, code: -1, type: InstructionType.Assembler, documentation: "プログラムの先頭を定義 プログラムの実行開始番地を定義 他のプログラムで参照する入口名を定義" },
{ instructionName: "END", argumentType: ArgumentType.none, code: -1, type: InstructionType.Assembler, documentation: "プログラムの終わりを明示" },
Expand Down
10 changes: 8 additions & 2 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,20 @@
],
"no-internal-module": true,
"no-trailing-whitespace": true,
"no-inferrable-types": true,
"no-inferrable-types": [
true
],
"no-null-keyword": true,
"boolean-trivia": true,
"type-operator-spacing": true,
"prefer-const": true,
"no-increment-decrement": true,
"object-literal-surrounding-space": true,
"no-type-assertion-whitespace": true,
"no-in-operator": true
"no-in-operator": true,
"array-type": [
true,
"array"
]
}
}

0 comments on commit a213002

Please sign in to comment.