Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;