Skip to content

Commit

Permalink
chore: pr updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Aug 2, 2021
1 parent 3e5ea22 commit 7393883
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
10 changes: 9 additions & 1 deletion 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';
Expand Down
8 changes: 3 additions & 5 deletions packages/typescript-estree/src/parser.ts
Expand Up @@ -498,7 +498,7 @@ function parseWithNodeMaps<T extends TSESTreeOptions = TSESTreeOptions>(

let parseAndGenerateServicesCalls: { [fileName: string]: number } = {};
// Privately exported utility intended for use in typescript-eslint unit tests only
function ɵclearParseAndGenerateServicesCalls(): void {
function clearParseAndGenerateServicesCalls(): void {
parseAndGenerateServicesCalls = {};
}

Expand Down Expand Up @@ -586,9 +586,7 @@ function parseAndGenerateServices<T extends TSESTreeOptions = TSESTreeOptions>(

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 (
Expand Down Expand Up @@ -651,5 +649,5 @@ export {
ParseAndGenerateServicesResult,
ParseWithNodeMapsResult,
clearProgramCache,
ɵclearParseAndGenerateServicesCalls,
clearParseAndGenerateServicesCalls,
};
Expand Up @@ -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 = {
Expand Down

0 comments on commit 7393883

Please sign in to comment.