diff --git a/packages/parser/package.json b/packages/parser/package.json index f2f1ac4574c..0f9cb1662aa 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -48,6 +48,7 @@ "@typescript-eslint/scope-manager": "5.48.2", "@typescript-eslint/types": "5.48.2", "@typescript-eslint/typescript-estree": "5.48.2", + "@typescript-eslint/visitor-keys": "5.48.2", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index 78894bc7a58..22a210892e9 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -9,10 +9,8 @@ import type { ParserServices, TSESTreeOptions, } from '@typescript-eslint/typescript-estree'; -import { - parseAndGenerateServices, - visitorKeys, -} from '@typescript-eslint/typescript-estree'; +import { parseAndGenerateServices } from '@typescript-eslint/typescript-estree'; +import { visitorKeys } from '@typescript-eslint/visitor-keys'; import debug from 'debug'; import type * as ts from 'typescript'; import { ScriptTarget } from 'typescript'; @@ -43,14 +41,14 @@ function validateBoolean( const LIB_FILENAME_REGEX = /lib\.(.+)\.d\.[cm]?ts$/; function getLib(compilerOptions: ts.CompilerOptions): Lib[] { if (compilerOptions.lib) { - return compilerOptions.lib.reduce((acc, lib) => { + return compilerOptions.lib.reduce((acc, lib) => { const match = LIB_FILENAME_REGEX.exec(lib.toLowerCase()); if (match) { acc.push(match[1] as Lib); } return acc; - }, [] as Lib[]); + }, []); } const target = compilerOptions.target ?? ScriptTarget.ES5; diff --git a/packages/typescript-estree/src/index.ts b/packages/typescript-estree/src/index.ts index 4a6187ac2cc..498082385a2 100644 --- a/packages/typescript-estree/src/index.ts +++ b/packages/typescript-estree/src/index.ts @@ -21,9 +21,6 @@ export * from './create-program/getScriptKind'; export { typescriptVersionIsAtLeast } from './version-check'; export * from './getModifiers'; -// re-export for backwards-compat -export { visitorKeys } from '@typescript-eslint/visitor-keys'; - // note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access export const version: string = require('../package.json').version;