From fdaa6db1ebcfd12dd80f73557d0fe233260ba2ec Mon Sep 17 00:00:00 2001 From: Johannes Choo Date: Wed, 8 Nov 2017 04:03:53 +0800 Subject: [PATCH] incorporate feedback from @adidahiya on PR for issue (#1598) --- docs/usage/configuration/index.md | 2 +- src/configuration.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/usage/configuration/index.md b/docs/usage/configuration/index.md index ad8a39c7641..e9a6f4097db 100644 --- a/docs/usage/configuration/index.md +++ b/docs/usage/configuration/index.md @@ -4,7 +4,7 @@ title: Configuring TSLint permalink: /usage/configuration/ --- -### The `tslint` File +### TSLint Configuration When using [the CLI][0] or many [third-party tools][1], a file named `tslint.json` or `tslint.yaml` is used to configure which rules get run and each of their options. diff --git a/src/configuration.ts b/src/configuration.ts index e18ec73e41b..baa544187dd 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -224,7 +224,8 @@ export function loadConfigurationFromPath(configFilePath?: string, originalFileP try { if (resolvedConfigFileExt === ".json") { rawConfigFile = JSON.parse(stripComments(fileContent)) as RawConfigFile; - } else { // /\.ya?ml/.test(resolvedConfigFileExt) === true + } else { + // choose this branch only if /\.ya?ml/.test(resolvedConfigFileExt) === true rawConfigFile = yaml.safeLoad(fileContent, { // Note: yaml.LoadOptions expects a schema value of type "any", // but this trips up the no-unsafe-any rule.