public void FindForSingleItemRoot()
        {
            string projectItemFullName = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/a/c/file4.ts");
            string result   = TsconfigLocations.FindParentTsconfig(projectItemFullName);
            string expected = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/a/tsconfig.json");

            Assert.AreEqual(expected, result);
        }
        public void FindForSingleItemNotsconfig()
        {
            // Note there's a tsconfig.json in the folder, but it's not in the project: it shouldn't be picked up
            string projectItemFullName = Path.GetFullPath(@"../../artifacts/tsconfig/none/b/file2.ts");
            string result = TsconfigLocations.FindParentTsconfig(projectItemFullName);

            Assert.IsNull(result);
        }
Esempio n. 3
0
 private static async Task LintFile(string filePath)
 {
     Benchmark.Start();
     Benchmark.Log("In SourceFileCreationListener.LintFile, path=" + filePath);
     if (WebLinterPackage.Settings.UseTsConfig)
     {
         string tsconfig = TsconfigLocations.FindParentTsconfig(filePath);
         if (tsconfig == null)
         {
             return;
         }
         await LinterService.Lint(false, false, false, new string[] { tsconfig },
                                  clearAllErrors : false, CreateFileToProjectMap(filePath));
     }
     else
     {
         await LinterService.Lint(false, false, false, new string[] { filePath },
                                  clearAllErrors : false, CreateFileToProjectMap(filePath));
     }
     Benchmark.End();
 }