From 739388385fa4dcc56d80de3e58c2413ae52c7075 Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 2 Aug 2021 12:16:36 +0400 Subject: [PATCH] chore: pr updates --- packages/typescript-estree/src/index.ts | 10 +++++++++- packages/typescript-estree/src/parser.ts | 8 +++----- .../tests/lib/semanticInfo-singleRun.test.ts | 4 ++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/typescript-estree/src/index.ts b/packages/typescript-estree/src/index.ts index b2a0581dc92..d6444271ee9 100644 --- a/packages/typescript-estree/src/index.ts +++ b/packages/typescript-estree/src/index.ts @@ -1,4 +1,12 @@ -export * from './parser'; +export { + AST, + parse, + parseAndGenerateServices, + parseWithNodeMaps, + ParseAndGenerateServicesResult, + ParseWithNodeMapsResult, + clearProgramCache, +} from './parser'; export { ParserServices, TSESTreeOptions } from './parser-options'; export { simpleTraverse } from './simple-traverse'; export * from './ts-estree'; diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index fdc035dbf02..54727a63fd3 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -498,7 +498,7 @@ function parseWithNodeMaps( let parseAndGenerateServicesCalls: { [fileName: string]: number } = {}; // Privately exported utility intended for use in typescript-eslint unit tests only -function ɵclearParseAndGenerateServicesCalls(): void { +function clearParseAndGenerateServicesCalls(): void { parseAndGenerateServicesCalls = {}; } @@ -586,9 +586,7 @@ function parseAndGenerateServices( if (extra.singleRun && options.filePath) { parseAndGenerateServicesCalls[options.filePath] = - parseAndGenerateServicesCalls[options.filePath] || 0; - parseAndGenerateServicesCalls[options.filePath] = - parseAndGenerateServicesCalls[options.filePath] + 1; + (parseAndGenerateServicesCalls[options.filePath] || 0) + 1; } if ( @@ -651,5 +649,5 @@ export { ParseAndGenerateServicesResult, ParseWithNodeMapsResult, clearProgramCache, - ɵclearParseAndGenerateServicesCalls, + clearParseAndGenerateServicesCalls, }; diff --git a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts index 2c551fbc026..62d7c3a841c 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts @@ -3,8 +3,8 @@ import * as path from 'path'; import { clearProgramCache, parseAndGenerateServices, - ɵclearParseAndGenerateServicesCalls as clearParseAndGenerateServicesCalls, -} from '../../src'; + clearParseAndGenerateServicesCalls, +} from '../../src/parser'; import { getCanonicalFileName } from '../../src/create-program/shared'; const mockProgram = {