Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: support `import { type Foo }` in check deps (#23405)

Dmitry Gozman06318d52d65b
diff --git a/utils/check_deps.js b/utils/check_deps.js
index 89a18eb7e5..eb31eab781 100644
--- a/utils/check_deps.js
+++ b/utils/check_deps.js
@@ -113,8 +113,14 @@ async function innerCheckDeps(root) {
function visit(node, fileName) {
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier)) {
- if (node.importClause && node.importClause.isTypeOnly)
- return;
+ if (node.importClause) {
+ if (node.importClause.isTypeOnly)
+ return;
+ if (node.importClause.namedBindings && ts.isNamedImports(node.importClause.namedBindings)) {
+ if (node.importClause.namedBindings.elements.every(e => e.isTypeOnly))
+ return;
+ }
+ }
const importName = node.moduleSpecifier.text;
let importPath;
if (importName.startsWith('.')) {