Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fac5c7d

Browse files
authored
fix(experimental-utils): Avoid typescript import at runtime (typescript-eslint#584)
See: typescript-eslint#425 (comment)
1 parent 50a493e commit fac5c7d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/experimental-utils/src/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ export { ESLintUtils, TSESLint, TSESLintScope };
66

77
// for convenience's sake - export the types directly from here so consumers
88
// don't need to reference/install both packages in their code
9+
10+
// NOTE - this uses hard links inside ts-estree to avoid initing the entire package
11+
// via its main file (which imports typescript at runtime).
12+
// Not every eslint-plugin written in typescript requires typescript at runtime.
913
export {
1014
AST_NODE_TYPES,
1115
AST_TOKEN_TYPES,
12-
ParserServices,
1316
TSESTree,
14-
} from '@typescript-eslint/typescript-estree';
17+
} from '@typescript-eslint/typescript-estree/dist/ts-estree';
18+
export {
19+
ParserServices,
20+
} from '@typescript-eslint/typescript-estree/dist/parser-options';

0 commit comments

Comments
 (0)