From 8385d5c889bf692710aaaba7128bbf5e8a490b96 Mon Sep 17 00:00:00 2001 From: Wolfgang Faust Date: Fri, 12 May 2017 17:46:54 -0400 Subject: [PATCH] xlsx: Linter: Require interfaces to start with 'I' The default rule for DT is that they're *not*, but changing that now would break existing usages of the xlsx typings. --- tslint.json | 7 ++++++- xlsx-tests.ts | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tslint.json b/tslint.json index 3db14f8..5107fb4 100644 --- a/tslint.json +++ b/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [true, "always-prefix"] + } +} diff --git a/xlsx-tests.ts b/xlsx-tests.ts index 83d0b19..1d25a94 100644 --- a/xlsx-tests.ts +++ b/xlsx-tests.ts @@ -15,11 +15,11 @@ const firstworksheet = workbook.Sheets[firstsheet]; console.log(firstworksheet["A1"]); -interface tester { +interface ITester { name: string; age: number; } -const jsonvalues: tester[] = xlsx.utils.sheet_to_json(firstworksheet); +const jsonvalues: ITester[] = xlsx.utils.sheet_to_json(firstworksheet); const csv = xlsx.utils.sheet_to_csv(firstworksheet); const formulae = xlsx.utils.sheet_to_formulae(firstworksheet);