Skip to content

Commit 9c58d40

Browse files
committed
Remove babel/types dependency
1 parent 07ca043 commit 9c58d40

File tree

3 files changed

+6
-52
lines changed

3 files changed

+6
-52
lines changed

package-lock.json

Lines changed: 2 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@
4646
"test": "vitest",
4747
"typecheck": "tsc --noEmit"
4848
},
49-
"dependencies": {
50-
"@babel/types": "^7.24.0"
51-
},
49+
"dependencies": {},
5250
"devDependencies": {
5351
"@eslint/js": "^9.0.0",
5452
"@types/eslint": "^8.56.9",

src/utils/loggerCallTracker.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Rule } from 'eslint';
22
import { BlockStatement, ReturnStatement, ThrowStatement } from 'estree';
3-
import t from '@babel/types';
43
import { Settings } from './settings';
54

65
interface ScopeStackEntry {
@@ -56,12 +55,9 @@ export function createLoggerCallTracker(settings: Settings, report: (node: Rule.
5655
}
5756

5857
if (
59-
// @ts-expect-error TODO: replace with custom guard
60-
t.isArrowFunctionExpression(parent) ||
61-
// @ts-expect-error TODO: replace with custom guard
62-
t.isFunctionDeclaration(parent) ||
63-
// @ts-expect-error TODO: replace with custom guard
64-
t.isFunctionExpression(parent)
58+
parent.type === 'ArrowFunctionExpression' ||
59+
parent.type === 'FunctionDeclaration' ||
60+
parent.type === 'FunctionExpression'
6561
) {
6662
return true;
6763
}

0 commit comments

Comments
 (0)