From 9780ab6fa25efe095f5ab342dd60e48c57d98bbd Mon Sep 17 00:00:00 2001 From: forehalo Date: Tue, 10 Dec 2024 07:04:57 +0000 Subject: [PATCH] chore: fix oxlint (#9086) --- oxlint.json | 3 ++- packages/frontend/graphql/export-gql-plugin.cjs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/oxlint.json b/oxlint.json index 91053e4462..d9e426e16e 100644 --- a/oxlint.json +++ b/oxlint.json @@ -18,7 +18,8 @@ { "ignoreTypes": true } - ] + ], + "import/namespace": "off" }, "overrides": [ { diff --git a/packages/frontend/graphql/export-gql-plugin.cjs b/packages/frontend/graphql/export-gql-plugin.cjs index a08c5fe5c6..0d8baf2522 100644 --- a/packages/frontend/graphql/export-gql-plugin.cjs +++ b/packages/frontend/graphql/export-gql-plugin.cjs @@ -1,5 +1,5 @@ -const fs = require('fs'); -const path = require('path'); +const fs = require('node:fs'); +const path = require('node:path'); const { Kind, print } = require('graphql'); const { upperFirst, lowerFirst } = require('lodash'); @@ -138,7 +138,7 @@ module.exports = { if (schema.getType(type)?.name === 'Upload') return true; const typeDef = schema.getType(type); const fields = typeDef.getFields?.(); - if (!fields || !fields) return false; + if (!fields || !fields.length) return false; for (let field of Object.values(fields)) { let type = field.type; while (type.ofType) {