Skip to content

Commit

Permalink
chore(typescript-estree): remove visitor-keys backwards compat export (
Browse files Browse the repository at this point in the history
…#6242)

* chore(typescript-estree): remove visitor-keys backwards compat export

* Fix our own internal import, haha

* Add missing dependency
  • Loading branch information
JoshuaKGoldberg committed Jan 30, 2023
1 parent 820bdf2 commit fde95d3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/parser/package.json
Expand Up @@ -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": {
Expand Down
10 changes: 4 additions & 6 deletions packages/parser/src/parser.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -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<Lib[]>((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;
Expand Down
3 changes: 0 additions & 3 deletions packages/typescript-estree/src/index.ts
Expand Up @@ -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;

0 comments on commit fde95d3

Please sign in to comment.