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 = {