Skip to content

Commit 59811bd

Browse files
committed
style(compat-eslint): unify typescript import to namespace form
`lib/ts-scope-manager.ts` was the only file using `import ts = require('typescript')` while the other three lib files used `import * as ts from 'typescript'`. Both forms work for the `export = ts` shape under `module: Node16`, but `ts` is only ever used as a namespace (`ts.SyntaxKind`, `ts.factory`, etc.) — `import * as` reads more naturally for that. The remaining `import = require` (`CodePathAnalyzer`) stays as is — CPA is used as a constructor, not a namespace, so the bare- value form is the right shape there.
1 parent 8d4e08f commit 59811bd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/compat-eslint/lib/ts-scope-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// would miss block-scopes-without-decls that ESLint expects.
1212

1313
import type { TSESTree } from '@typescript-eslint/types';
14-
import ts = require('typescript');
14+
import * as ts from 'typescript';
1515
import { materialize } from './lazy-estree';
1616

1717
type AstMaps = {

0 commit comments

Comments
 (0)