예제 #1
0
        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");
            Tsconfig result = TsconfigLocations.FindFromProjectItem(projectItemFullName);

            Assert.IsNull(result);
        }
예제 #2
0
        public void FindForSingleItemRoot()
        {
            string   projectItemFullName = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/a/c/file4.ts");
            Tsconfig result   = TsconfigLocations.FindFromProjectItem(projectItemFullName);
            string   expected = Path.GetFullPath(@"../../artifacts/tsconfig/multiple/a/tsconfig.json");

            Assert.AreEqual(expected, result.FullName);
        }
예제 #3
0
 private static async Task CallLinterService(string filePath)
 {
     if (WebLinterPackage.Settings.UseTsConfig)
     {
         Tsconfig tsconfig = TsconfigLocations.FindFromProjectItem(filePath);
         if (tsconfig == null)
         {
             return;
         }
         await LinterService.Lint(false, false, false, new string[] { tsconfig.FullName },
                                  new string[] { filePath });
     }
     else
     {
         await LinterService.Lint(false, false, false, new string[] { filePath });
     }
 }