chore: revert eslint upgrade (#7907)

This commit is contained in:
Laurin 2026-03-25 09:56:26 +01:00 committed by GitHub
parent e5711a52a8
commit 982d042b3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 977 additions and 3040 deletions

View file

@ -55,8 +55,6 @@ module.exports = {
'packages/web/app/src/gql/**/*',
'codegen.cjs',
'tsup',
'packages/libraries/render-laboratory/src/laboratory.ts',
'packages/web/app/vite.config.ts',
],
overrides: [
{
@ -65,14 +63,8 @@ module.exports = {
parser: '@graphql-eslint/eslint-plugin',
plugins: ['@graphql-eslint'],
parserOptions: {
graphQLConfig: {
schema: SCHEMA_PATH,
operations: OPERATIONS_PATHS,
documents: OPERATIONS_PATHS,
},
},
rules: {
'@graphql-eslint/require-selections': 'error',
schema: SCHEMA_PATH,
operations: OPERATIONS_PATHS,
},
},
{
@ -84,6 +76,7 @@ module.exports = {
files: ['packages/web/app/**/*.graphql'],
plugins: ['@graphql-eslint'],
rules: {
'@graphql-eslint/require-id-when-available': 'error',
'@graphql-eslint/no-deprecated': 'error',
},
},
@ -151,16 +144,6 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/triple-slash-reference': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrors: 'none',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
{

View file

@ -32,8 +32,5 @@ CHANGELOG.md
.hive/
.hive-dev/
# File generated by laboratory
packages/libraries/render-laboratory/src/laboratory.ts
# File generated by @hive/app#generate-changelog script
packages/web/app/src/components/ui/changelog/generated-changelog.ts

View file

@ -32,7 +32,7 @@
"graphql:generate": "VERBOSE=1 graphql-codegen --config codegen.mts",
"graphql:generate:watch": "pnpm graphql:generate --watch",
"integration:prepare": "cd integration-tests && ./local.sh",
"lint": "NODE_OPTIONS=\"--max-old-space-size=8192\" eslint --cache --ignore-path .gitignore \"{packages,cypress}/**/*.{ts,tsx,graphql}\"",
"lint": "eslint --cache --ignore-path .gitignore \"{packages,cypress}/**/*.{ts,tsx,graphql}\"",
"lint:env-template": "tsx scripts/check-env-template.ts",
"lint:fix": "pnpm lint --fix",
"lint:prettier": "prettier --cache --check .",
@ -72,7 +72,7 @@
"@graphql-codegen/typescript-operations": "5.0.2",
"@graphql-codegen/typescript-resolvers": "5.1.0",
"@graphql-codegen/urql-introspection": "3.0.1",
"@graphql-eslint/eslint-plugin": "4.4.0",
"@graphql-eslint/eslint-plugin": "3.20.1",
"@graphql-inspector/cli": "6.0.6",
"@graphql-inspector/core": "7.1.2",
"@graphql-inspector/patch": "0.1.3",
@ -82,7 +82,7 @@
"@parcel/watcher": "2.5.1",
"@sentry/cli": "2.40.0",
"@swc/core": "1.13.5",
"@theguild/eslint-config": "0.13.1",
"@theguild/eslint-config": "0.12.1",
"@theguild/federation-composition": "0.22.1",
"@theguild/prettier-config": "2.0.7",
"@types/node": "24.10.9",
@ -90,7 +90,7 @@
"cypress": "13.17.0",
"dotenv": "16.4.7",
"eslint": "8.57.1",
"eslint-plugin-better-tailwindcss": "^4.3.2",
"eslint-plugin-better-tailwindcss": "^4.0.0",
"eslint-plugin-cypress": "4.1.0",
"eslint-plugin-hive": "file:rules",
"fs-extra": "11.2.0",
@ -171,6 +171,7 @@
"@apollo/federation@0.38.1": "patches/@apollo__federation@0.38.1.patch",
"@theguild/editor@1.2.5": "patches/@theguild__editor@1.2.5.patch",
"eslint@8.57.1": "patches/eslint@8.57.1.patch",
"@graphql-eslint/eslint-plugin@3.20.1": "patches/@graphql-eslint__eslint-plugin@3.20.1.patch",
"got@14.4.7": "patches/got@14.4.7.patch",
"slonik@30.4.4": "patches/slonik@30.4.4.patch",
"@oclif/core@3.26.6": "patches/@oclif__core@3.26.6.patch",

View file

@ -60,7 +60,11 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
protected logger: Logger = {
info: (...args) => this.logInfo(...args),
error: (...args) => this.logFailure(...args),
debug: (...args) => this.logDebug(...args),
debug: (...args) => {
if (this.flags.debug) {
this.logInfo(...args);
}
},
};
logSuccess(...args: any[]) {
@ -79,12 +83,6 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
this.log(Texture.warning(...args));
}
logDebug(...args: any[]) {
if (this.flags.debug) {
this.logInfo(...args);
}
}
maybe<TArgs extends Record<string, any>, TKey extends keyof TArgs>({
key,
env,
@ -217,7 +215,6 @@ export default abstract class BaseCommand<T extends typeof Command> extends Comm
return fileContent;
} catch (e) {
this.logFailure(e);
throw new InvalidFileContentsError(file, 'JSON');
}
}

View file

@ -61,7 +61,6 @@ export default class AppCreate extends Command<typeof AppCreate> {
description: AppCreate.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
@ -73,7 +72,6 @@ export default class AppCreate extends Command<typeof AppCreate> {
description: AppCreate.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -49,7 +49,6 @@ export default class AppPublish extends Command<typeof AppPublish> {
description: AppPublish.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
@ -61,7 +60,6 @@ export default class AppPublish extends Command<typeof AppPublish> {
description: AppPublish.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -53,7 +53,6 @@ export default class AppRetire extends Command<typeof AppRetire> {
description: AppRetire.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
@ -65,7 +64,6 @@ export default class AppRetire extends Command<typeof AppRetire> {
description: AppRetire.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -41,7 +41,6 @@ export default class ArtifactsFetch extends Command<typeof ArtifactsFetch> {
description: ArtifactsFetch.flags['cdn.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingCdnEndpointError();
}
@ -53,7 +52,6 @@ export default class ArtifactsFetch extends Command<typeof ArtifactsFetch> {
description: ArtifactsFetch.flags['cdn.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingCdnKeyError();
}

View file

@ -211,7 +211,6 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
try {
@ -223,7 +222,6 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}
@ -272,7 +270,6 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
try {
@ -284,7 +281,6 @@ export default class Dev extends Command<typeof Dev> {
description: Dev.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -111,7 +111,6 @@ export default class OperationsCheck extends Command<typeof OperationsCheck> {
description: OperationsCheck.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
@ -124,7 +123,6 @@ export default class OperationsCheck extends Command<typeof OperationsCheck> {
description: OperationsCheck.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -210,7 +210,6 @@ export default class SchemaCheck extends Command<typeof SchemaCheck> {
description: SchemaCheck.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
const file = args.file;
@ -223,7 +222,6 @@ export default class SchemaCheck extends Command<typeof SchemaCheck> {
description: SchemaCheck.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -111,7 +111,6 @@ export default class SchemaDelete extends Command<typeof SchemaDelete> {
description: SchemaDelete.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
try {
@ -123,7 +122,6 @@ export default class SchemaDelete extends Command<typeof SchemaDelete> {
description: SchemaDelete.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -149,7 +149,6 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
description: SchemaFetch.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
try {
@ -161,7 +160,6 @@ export default class SchemaFetch extends Command<typeof SchemaFetch> {
description: SchemaFetch.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -166,7 +166,6 @@ export default class SchemaPublish extends Command<typeof SchemaPublish> {
return metadata;
} catch (e) {
this.logDebug(e);
// If we can't parse it, we can try to load it from FS
return this.readJSON(metadata);
}
@ -189,7 +188,6 @@ export default class SchemaPublish extends Command<typeof SchemaPublish> {
description: SchemaPublish.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
try {
@ -201,7 +199,6 @@ export default class SchemaPublish extends Command<typeof SchemaPublish> {
description: SchemaPublish.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}
const service = flags.service;

View file

@ -78,7 +78,6 @@ export default class WhoAmI extends Command<typeof WhoAmI> {
description: WhoAmI.flags['registry.endpoint'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingEndpointError();
}
@ -91,7 +90,6 @@ export default class WhoAmI extends Command<typeof WhoAmI> {
description: WhoAmI.flags['registry.accessToken'].description!,
});
} catch (e) {
this.logDebug(e);
throw new MissingRegistryTokenError();
}

View file

@ -142,7 +142,7 @@ export class Config {
throw new Error('Invalid config.');
}
}
} catch (_error) {
} catch (error) {
this.cache = {
registry: {
endpoint: undefined,

View file

@ -73,7 +73,6 @@ export function graphqlRequest(config: {
try {
jsonData = (await response.json()) as ExecutionResult<TResult>;
} catch (err) {
config.logger?.debug?.(String(err));
const contentType = response?.headers?.get('content-type');
throw new APIError(
`Response from graphql was not valid JSON.${contentType ? ` Received "content-type": "${contentType}".` : ''}`,

View file

@ -227,7 +227,7 @@ class FederationSubgraphUrlLoader implements Loader {
name
}
}
`) as TypedDocumentNode<{ __type: null | { name: string } }, Record<string, never>>,
`) as TypedDocumentNode<{ __type: null | { name: string } }, {}>,
});
if (isSubgraph.__type === null) {
@ -247,7 +247,7 @@ class FederationSubgraphUrlLoader implements Loader {
sdl
}
}
`) as TypedDocumentNode<{ _service: { sdl: string } }, Record<string, never>>,
`) as TypedDocumentNode<{ _service: { sdl: string } }, {}>,
});
this.logger?.debug?.('Resolved subgraph SDL successfully.');

View file

@ -6,9 +6,9 @@
import { createAgent } from '../src/client/agent.js';
let data: Array<object> = [];
let data: Array<{}> = [];
const agent = createAgent<object>(
const agent = createAgent<{}>(
{
debug: true,
endpoint: 'http://127.0.0.1',

View file

@ -113,9 +113,7 @@ export async function initMigrationTestingEnvironment() {
await runPGMigrations({ slonik });
},
async done(deleteDb = true) {
if (deleteDb) {
await db.query(`DROP DATABASE ${dbName};`);
}
deleteDb ?? (await db.query(`DROP DATABASE ${dbName};`));
await db.$pool.end().catch();
},
};

View file

@ -12,7 +12,6 @@ export interface RegistryContext {
declare global {
namespace GraphQLModules {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
interface GlobalContext extends RegistryContext {}
}
}

View file

@ -1,7 +1,7 @@
import type { Scalars } from '../../__generated__/types';
import type { AdminOrganizationStats } from '../../shared/entities';
export type AdminQueryMapper = object;
export type AdminQueryMapper = {};
export type AdminStatsMapper = {
period: {
from: Scalars['DateTime']['input'];

View file

@ -52,7 +52,7 @@ export class AppDeployments {
private storage: Storage,
private schemaVersionHelper: SchemaVersionHelper,
private persistedDocumentScheduler: PersistedDocumentScheduler,
@Inject(APP_DEPLOYMENTS_ENABLED) private appDeploymentsEnabled: boolean,
@Inject(APP_DEPLOYMENTS_ENABLED) private appDeploymentsEnabled: Boolean,
) {
this.logger = logger.child({ source: 'AppDeployments' });
}

View file

@ -37,10 +37,7 @@ const ThirdpartUserModel = z.object({
timeJoined: z.number(),
});
export const EmailPasswordOrThirdPartyUserModel = z.union([
EmailPasswordUserModel,
ThirdpartUserModel,
]);
const EmailPasswordOrThirdPartyUserModel = z.union([EmailPasswordUserModel, ThirdpartUserModel]);
export type EmailPasswordOrThirdPartyUser = z.TypeOf<typeof EmailPasswordOrThirdPartyUserModel>;

View file

@ -40,7 +40,7 @@ export class SchemaProposalStorage {
logger: Logger,
@Inject(PG_POOL_CONFIG) private pool: DatabasePool,
private storage: Storage,
@Inject(SCHEMA_PROPOSALS_ENABLED) private schemaProposalsEnabled: boolean,
@Inject(SCHEMA_PROPOSALS_ENABLED) private schemaProposalsEnabled: Boolean,
private taskScheduler: TaskScheduler,
) {
this.logger = logger.child({ source: 'SchemaProposalStorage' });

View file

@ -52,6 +52,8 @@ export class RedisRateLimiter {
}
}
req.routeOptions.url;
let ip = req.ip;
if (this.config.config.ipHeaderName && req.headers[this.config.config.ipHeaderName]) {

View file

@ -68,9 +68,7 @@ const handler: ExportedHandler<Env> = {
};
function flush() {
if (loki) {
ctx.waitUntil(loki.flush());
}
loki && ctx.waitUntil(loki.flush());
}
try {

View file

@ -9,7 +9,7 @@
"typecheck": "tsc --noEmit"
},
"devDependencies": {
"@graphql-eslint/eslint-plugin": "4.4.0",
"@graphql-eslint/eslint-plugin": "3.20.1",
"@hive/service-common": "workspace:*",
"@sentry/node": "7.120.2",
"@sentry/tracing": "7.114.0",

View file

@ -95,9 +95,7 @@ export async function schemaPolicyCheck(input: {
input.source,
{
parser: '@graphql-eslint/eslint-plugin',
parserOptions: {
schemaSdl: input.schema,
},
parserOptions: { schema: input.schema },
rules: input.policy,
},
'schema.graphql',

View file

@ -461,7 +461,7 @@ export async function main() {
method: ['GET', 'HEAD'],
url: '/_health',
async handler(_, res) {
res.status(200).send();
res.status(200).send(); // eslint-disable-line @typescript-eslint/no-floating-promises -- false positive, FastifyReply.then returns void
},
});
@ -490,7 +490,7 @@ export async function main() {
req.log.error(`Readiness check failed: [${response.statusCode}] ${response.body}`);
} else {
reportReadiness(true);
res.status(200).send();
res.status(200).send(); // eslint-disable-line @typescript-eslint/no-floating-promises -- false positive, FastifyReply.then returns void
return;
}
} catch (error) {
@ -498,7 +498,7 @@ export async function main() {
}
reportReadiness(false);
res.status(400).send();
res.status(400).send(); // eslint-disable-line @typescript-eslint/no-floating-promises -- false positive, FastifyReply.then returns void
},
});

View file

@ -29,9 +29,9 @@ const getHiveClientVersion = (userAgent: string | null) => {
};
export function useArmor<
PluginContext extends Record<string, any> = object,
TServerContext extends Record<string, any> = object,
TUserContext = object,
PluginContext extends Record<string, any> = {},
TServerContext extends Record<string, any> = {},
TUserContext = {},
>(): Plugin<PluginContext, TServerContext, TUserContext> {
return {
onValidate(ctx) {

View file

@ -456,7 +456,7 @@ type FunctionTraceOptions<TArgs extends any[], TResult> = {
errorAttributes?: Attributes | ((error: Error) => Attributes);
};
export function traceFn<This extends object, TArgs extends any[], TResult>(
export function traceFn<This extends Object, TArgs extends any[], TResult>(
spanName: string,
options?: FunctionTraceOptions<TArgs, Awaited<TResult>>,
) {

View file

@ -31,7 +31,6 @@ export const handleTRPCError = experimental_standaloneMiddleware<{
ctx: {
req: FastifyRequest;
};
// eslint-disable-next-line
input: {};
}>().create(async opts => {
const result = await opts.next();

View file

@ -76,9 +76,7 @@ export type { tokens, schema_policy_resource } from './db/types';
type Connection = DatabasePool | DatabaseTransactionConnection;
type OverrideProp<T extends Record<string, any>, K extends keyof T, V extends T[K]> = Omit<T, K> & {
[P in K]: V;
};
type OverrideProp<T extends {}, K extends keyof T, V extends T[K]> = Omit<T, K> & { [P in K]: V };
type schema_log = Omit<schema_log_in_db, 'action'> & {
action: 'PUSH' | 'DELETE';

View file

@ -1525,7 +1525,7 @@ export const InsertConditionalBreakingChangeMetadataModel =
},
})).nullable();
export const SchemaCheckInputModel = z.union([
const SchemaCheckInputModel = z.union([
z.intersection(
z.object({
isSuccess: z.literal(false),

View file

@ -8,10 +8,15 @@ interface Email {
date: Date;
}
type EmailProviders = 'postmark' | 'mock' | 'smtp' | 'sendmail';
const emailProviders = {
postmark,
mock,
smtp,
sendmail,
};
export interface EmailProvider {
id: EmailProviders;
id: keyof typeof emailProviders;
send(email: Omit<Email, 'date'>): Promise<void>;
history: Email[];
}

View file

@ -6,7 +6,7 @@ import { HiveStripeWrapper } from '@/lib/billing/stripe';
* Utility for wrapping a component with an authenticated container that has the default application layout.
*/
export const authenticated =
<TProps extends Record<string, any>>(Component: (props: TProps) => ReactElement | null) =>
<TProps extends {}>(Component: (props: TProps) => ReactElement | null) =>
(props: TProps) => {
return (
<SessionAuth>

View file

@ -15,7 +15,6 @@ const BillingView_OrganizationFragment = graphql(`
const BillingView_QueryFragment = graphql(`
fragment BillingView_QueryFragment on Query {
billingPlans {
id
planType
...PlanSummary_PlanFragment
}

View file

@ -6,7 +6,6 @@ import { CurrencyFormatter, formatMillionOrBillion } from './helpers';
const PriceEstimationTable_PlanFragment = graphql(`
fragment PriceEstimationTable_PlanFragment on BillingPlan {
id
includedOperationsLimit
pricePerOperationsUnit
basePrice

View file

@ -4,7 +4,6 @@ import { FragmentType, graphql, useFragment } from '@/gql';
const ProPlanBilling_OrganizationFragment = graphql(`
fragment ProPlanBilling_OrganizationFragment on Organization {
id
billingConfiguration {
hasPaymentIssues
}

View file

@ -40,14 +40,12 @@ const ExternalCompositionStatus_TestQuery = graphql(`
const ExternalCompositionSettings_OrganizationFragment = graphql(`
fragment ExternalCompositionSettings_OrganizationFragment on Organization {
id
slug
}
`);
const ExternalCompositionSettings_ProjectFragment = graphql(`
fragment ExternalCompositionSettings_ProjectFragment on Project {
id
slug
isNativeFederationEnabled
externalSchemaComposition {
@ -60,7 +58,6 @@ const ExternalCompositionSettings_UpdateResultFragment = graphql(`
fragment ExternalCompositionSettings_UpdateResultFragment on UpdateSchemaCompositionResult {
ok {
updatedProject {
id
externalSchemaComposition {
endpoint
}

View file

@ -47,7 +47,6 @@ const ChangesBlock_SchemaCheckConditionalBreakingChangeMetadataFragment = graphq
settings {
retentionInDays
targets {
id
slug
target {
id

View file

@ -81,7 +81,6 @@ const Proposals_SelectFragment = graphql(`
const Proposals_TargetProjectTypeFragment = graphql(`
fragment Proposals_TargetProjectTypeFragment on Target {
id
project {
id
type
@ -275,8 +274,7 @@ export function ProposalEditor(props: {
onValueChange={idx => {
try {
setActiveTab(parseInt(idx, 10));
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (_e: unknown) {
} catch (e) {
console.error('Cannot set active tab. Could not parse index.');
}
}}

View file

@ -20,7 +20,7 @@ const Command = React.forwardRef<
));
Command.displayName = CommandPrimitive.displayName;
type CommandDialogProps = DialogProps;
interface CommandDialogProps extends DialogProps {}
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
return (

View file

@ -12,6 +12,13 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement;
};
const actionTypes = {
ADD_TOAST: 'ADD_TOAST',
UPDATE_TOAST: 'UPDATE_TOAST',
DISMISS_TOAST: 'DISMISS_TOAST',
REMOVE_TOAST: 'REMOVE_TOAST',
} as const;
let count = 0;
function genId() {
@ -19,12 +26,7 @@ function genId() {
return count.toString();
}
type ActionType = {
ADD_TOAST: 'ADD_TOAST';
UPDATE_TOAST: 'UPDATE_TOAST';
DISMISS_TOAST: 'DISMISS_TOAST';
REMOVE_TOAST: 'REMOVE_TOAST';
};
type ActionType = typeof actionTypes;
type Action =
| {

View file

@ -7,7 +7,7 @@ import { Button } from '@/components/ui/button';
import { Heading } from '@/components/ui/heading';
import { ArrowDownIcon, CheckIcon } from '@/components/ui/icon';
import { Input, Modal } from '@/components/v2';
import { DocumentType, FragmentType, graphql, useFragment } from '@/gql';
import { FragmentType, graphql, useFragment } from '@/gql';
import { useNotifications } from '@/lib/hooks';
import { Combobox as HeadlessCombobox, Transition as HeadlessTransition } from '@headlessui/react';
@ -37,6 +37,7 @@ const TransferOrganizationOwnership_Members = graphql(`
node {
id
isOwner
...MemberFields
user {
id
fullName
@ -50,9 +51,22 @@ const TransferOrganizationOwnership_Members = graphql(`
}
`);
const MemberFields = graphql(`
fragment MemberFields on Member {
id
user {
id
fullName
displayName
email
}
isOwner
}
`);
type Member = NonNullable<
DocumentType<typeof TransferOrganizationOwnership_Members>['organization']
>['members']['edges'][number]['node'];
FragmentType<typeof MemberFields>[' $fragmentRefs']
>['MemberFieldsFragment'];
const TransferOrganizationOwnershipModal_OrganizationFragment = graphql(`
fragment TransferOrganizationOwnershipModal_OrganizationFragment on Organization {

View file

@ -37,8 +37,7 @@ const dateStringFormat = 'yyyy-MM-dd HH:mm';
function parseDateString(input: string) {
try {
return parseDate(input, dateStringFormat, new UTCDate());
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (_error: unknown) {
} catch (error) {
return undefined;
}
}

View file

@ -67,7 +67,6 @@ const DeleteGitHubIntegrationMutation = graphql(`
const GitHubIntegrationSection_OrganizationFragment = graphql(`
fragment GitHubIntegrationSection_OrganizationFragment on Organization {
id
hasGitHubIntegration
slug
}
@ -114,7 +113,6 @@ function GitHubIntegrationSection(props: {
const SlackIntegrationSection_OrganizationFragment = graphql(`
fragment SlackIntegrationSection_OrganizationFragment on Organization {
id
hasSlackIntegration
slug
}

View file

@ -228,7 +228,6 @@ const ConditionalBreakingChangesMetadataSection_SchemaCheckFragment = graphql(`
percentage
excludedClientNames
targets {
id
slug
target {
id

View file

@ -49,7 +49,7 @@ const DeprecatedSchemaView_DeprecatedSchemaExplorerFragment = graphql(`
}
`);
function InternalDeprecatedSchemaView(props: {
const DeprecatedSchemaView = memo(function _DeprecatedSchemaView(props: {
explorer: FragmentType<typeof DeprecatedSchemaView_DeprecatedSchemaExplorerFragment>;
totalRequests: number;
organizationSlug: string;
@ -150,9 +150,7 @@ function InternalDeprecatedSchemaView(props: {
</div>
</div>
);
}
const DeprecatedSchemaView = memo(InternalDeprecatedSchemaView);
});
const DeprecatedSchemaExplorer_DeprecatedSchemaQuery = graphql(`
query DeprecatedSchemaExplorer_DeprecatedSchemaQuery(

View file

@ -63,7 +63,7 @@ const UnusedSchemaView_UnusedSchemaExplorerFragment = graphql(`
}
`);
function InternalUnusedSchemaView(props: {
const UnusedSchemaView = memo(function _UnusedSchemaView(props: {
explorer: FragmentType<typeof UnusedSchemaView_UnusedSchemaExplorerFragment>;
totalRequests: number;
organizationSlug: string;
@ -209,9 +209,7 @@ function InternalUnusedSchemaView(props: {
</div>
</div>
);
}
const UnusedSchemaView = memo(InternalUnusedSchemaView);
});
const UnusedSchemaExplorer_UnusedSchemaQuery = graphql(`
query UnusedSchemaExplorer_UnusedSchemaQuery(

View file

@ -46,7 +46,7 @@ import { cn } from '@/lib/utils';
import * as SliderPrimitive from '@radix-ui/react-slider';
import * as dateMath from '../../lib/date-math';
type FilterInputProps = InputHTMLAttributes<HTMLInputElement>;
interface FilterInputProps extends InputHTMLAttributes<HTMLInputElement> {}
export const FilterInput = forwardRef<HTMLInputElement, FilterInputProps>(
({ className, type, ...props }, ref) => {

View file

@ -0,0 +1,122 @@
diff --git a/esm/estree-converter/utils.js b/esm/estree-converter/utils.js
index f57ab7f17cfc19de13cc969ee32bf44d4f6c361f..6db8f13220171ba109b131db6d5ba5bf7249e87a 100644
--- a/esm/estree-converter/utils.js
+++ b/esm/estree-converter/utils.js
@@ -1,11 +1,12 @@
-import { createRequire } from 'module';
-const require = createRequire(import.meta.url);
+// import { createRequire } from 'module';
+// const require = createRequire(import.meta.url);
import "../chunk-BMTV3EA2.js";
import {
isListType,
isNonNullType,
Source,
- TokenKind
+ TokenKind,
+ Lexer
} from "graphql";
import { valueFromASTUntyped } from "graphql/utilities/valueFromASTUntyped.js";
const valueFromNode = (...args) => {
@@ -41,15 +42,7 @@ function convertToken(token, type) {
};
}
function getLexer(source) {
- const gqlLanguage = require("graphql/language");
- if (gqlLanguage == null ? void 0 : gqlLanguage.createLexer) {
- return gqlLanguage.createLexer(source, {});
- }
- const { Lexer: LexerCls } = require("graphql");
- if (LexerCls && typeof LexerCls === "function") {
- return new LexerCls(source);
- }
- throw new Error("Unsupported GraphQL version! Please make sure to use GraphQL v14 or newer!");
+ return new Lexer(source)
}
function extractTokens(filePath, code) {
const source = new Source(code, filePath);
diff --git a/esm/index.js b/esm/index.js
index c70680ab5ef5a04c71db529015e879f91aedf2cf..402b56f8d4b0109d58411e6a5c002b8f69fc40d6 100644
--- a/esm/index.js
+++ b/esm/index.js
@@ -2,7 +2,7 @@ import "./chunk-BMTV3EA2.js";
import { processor } from "./processor.js";
import { parseForESLint } from "./parser.js";
import { rules } from "./rules/index.js";
-export * from "./testkit.js";
+// export * from "./testkit.js";
export * from "./types.js";
import { requireGraphQLSchemaFromContext, requireSiblingsOperations } from "./utils.js";
const processors = { graphql: processor };
diff --git a/esm/parser.js b/esm/parser.js
index 8dc131164b22e24c227d2296d16899a6abb4f692..b1870bc8472fe52e045eaa85b15fe0cac0f8c383 100644
--- a/esm/parser.js
+++ b/esm/parser.js
@@ -3,10 +3,10 @@ import { parseGraphQLSDL } from "@graphql-tools/utils";
import debugFactory from "debug";
import { buildSchema, GraphQLError } from "graphql";
import { convertToESTree, extractComments, extractTokens } from "./estree-converter/index.js";
-import { loadGraphQLConfig } from "./graphql-config.js";
+// import { loadGraphQLConfig } from "./graphql-config.js";
import { getSchema } from "./schema.js";
import { getSiblings } from "./siblings.js";
-import { CWD, VIRTUAL_DOCUMENT_REGEX } from "./utils.js";
+import { CWD, /*VIRTUAL_DOCUMENT_REGEX*/ } from "./utils.js";
const debug = debugFactory("graphql-eslint:parser");
debug("cwd %o", CWD);
function parseForESLint(code, options) {
@@ -18,9 +18,9 @@ function parseForESLint(code, options) {
...options.graphQLParserOptions,
noLocation: false
});
- const gqlConfig = loadGraphQLConfig(options);
- const realFilepath = filePath.replace(VIRTUAL_DOCUMENT_REGEX, "");
- const project = gqlConfig.getProjectForFile(realFilepath);
+ // const gqlConfig = loadGraphQLConfig(options);
+ // const realFilepath = filePath.replace(VIRTUAL_DOCUMENT_REGEX, "");
+ let project;
let schema = null;
try {
schema = project ? getSchema(project, options.schemaOptions) : typeof options.schema === "string" ? buildSchema(options.schema) : null;
diff --git a/esm/rules/graphql-js-validation.js b/esm/rules/graphql-js-validation.js
index d952cee1e10976459e7c5836b86ba6540c45fdb6..d314997bfd26477c7d823cad397eb5d65d147806 100644
--- a/esm/rules/graphql-js-validation.js
+++ b/esm/rules/graphql-js-validation.js
@@ -1,5 +1,6 @@
-import { createRequire } from 'module';
-const require = createRequire(import.meta.url);
+// import { createRequire } from 'module';
+// const require = createRequire(import.meta.url);
+import * as allGraphQLJSRules from 'graphql/validation/index.js'
import "../chunk-BMTV3EA2.js";
import {
Kind,
@@ -112,16 +113,18 @@ const validationToRule = ({
schema = [],
hasDidYouMeanSuggestions
}, docs) => {
- let ruleFn = null;
- try {
- ruleFn = require(`graphql/validation/rules/${ruleName}Rule`)[`${ruleName}Rule`];
- } catch {
- try {
- ruleFn = require(`graphql/validation/rules/${ruleName}`)[`${ruleName}Rule`];
- } catch {
- ruleFn = require("graphql/validation")[`${ruleName}Rule`];
- }
- }
+ // let ruleFn = null;
+ // try {
+ // ruleFn = require(`graphql/validation/rules/${ruleName}Rule`)[`${ruleName}Rule`];
+ // } catch {
+ // try {
+ // ruleFn = require(`graphql/validation/rules/${ruleName}`)[`${ruleName}Rule`];
+ // } catch {
+ // ruleFn = require("graphql/validation")[`${ruleName}Rule`];
+ // }
+ // }
+ let ruleFn = allGraphQLJSRules[`${ruleName}Rule`];
+
return {
[ruleId]: {
meta: {

File diff suppressed because it is too large Load diff