Skip to content

Commit 6a50740

Browse files
authored
graphiql 5: set "importsNotUsedAsValues": "error" in tsconfig (#4025)
* upd * upd * upd * upd * upd * set `"importsNotUsedAsValues": "error"` in tsconfig * add changeset
1 parent 1b7fa8d commit 6a50740

40 files changed

+61
-52
lines changed

.changeset/pink-onions-complain.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'@graphiql/plugin-code-exporter': minor
3+
'@graphiql/plugin-doc-explorer': minor
4+
'@graphiql/plugin-history': minor
5+
'@graphiql/react': minor
6+
'graphiql': minor
7+
---
8+
9+
set "importsNotUsedAsValues": "error" in tsconfig

packages/graphiql-plugin-code-exporter/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useOperationsEditorState, type GraphiQLPlugin } from '@graphiql/react';
2-
import { FC } from 'react';
2+
import type { FC } from 'react';
33
import GraphiQLCodeExporter, {
44
GraphiQLCodeExporterProps,
55
} from 'graphiql-code-exporter';

packages/graphiql-plugin-doc-explorer/src/components/__tests__/doc-explorer.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Mock } from 'vitest';
1+
import type { Mock } from 'vitest';
22
import { useGraphiQL as $useGraphiQL } from '@graphiql/react';
33
import { render } from '@testing-library/react';
44
import { GraphQLInt, GraphQLObjectType, GraphQLSchema } from 'graphql';

packages/graphiql-plugin-doc-explorer/src/components/__tests__/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use no memo';
2-
import { GraphQLNamedType, GraphQLType } from 'graphql';
2+
import type { GraphQLNamedType, GraphQLType } from 'graphql';
33

44
export function unwrapType(type: GraphQLType): GraphQLNamedType {
55
return 'ofType' in type ? unwrapType(type.ofType) : type;

packages/graphiql-plugin-doc-explorer/src/components/__tests__/type-documentation.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC, useEffect } from 'react';
22
import { fireEvent, render } from '@testing-library/react';
3-
import { GraphQLNamedType } from 'graphql';
3+
import type { GraphQLNamedType } from 'graphql';
44
import {
55
ExampleSchema,
66
ExampleEnum,
@@ -10,7 +10,7 @@ import {
1010
import { docExplorerStore } from '../../context';
1111
import { TypeDocumentation } from '../type-documentation';
1212
import { unwrapType } from './test-utils';
13-
import { SlicesWithActions } from '@graphiql/react';
13+
import type { SlicesWithActions } from '@graphiql/react';
1414

1515
vi.mock('@graphiql/react', async () => {
1616
const originalModule =

packages/graphiql-plugin-doc-explorer/src/components/argument.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { FC } from 'react';
2-
import { GraphQLArgument } from 'graphql';
1+
import type { FC } from 'react';
2+
import type { GraphQLArgument } from 'graphql';
33
import { MarkdownContent } from '@graphiql/react';
44
import { DefaultValue } from './default-value';
55
import { TypeLink } from './type-link';

packages/graphiql-plugin-doc-explorer/src/components/default-value.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { FC } from 'react';
1+
import type { FC } from 'react';
22
import { astFromValue, print, ValueNode } from 'graphql';
3-
import { DocExplorerFieldDef } from '../context';
3+
import type { DocExplorerFieldDef } from '../context';
44
import './default-value.css';
55

66
const printDefault = (ast?: ValueNode | null): string => {

packages/graphiql-plugin-doc-explorer/src/components/deprecation-reason.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { FC } from 'react';
1+
import type { FC } from 'react';
22
import { MarkdownContent } from '@graphiql/react';
33
import './deprecation-reason.css';
44

packages/graphiql-plugin-doc-explorer/src/components/directive.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { FC } from 'react';
2-
import { DirectiveNode } from 'graphql';
1+
import type { FC } from 'react';
2+
import type { DirectiveNode } from 'graphql';
33
import './directive.css';
44

55
type DirectiveProps = {

packages/graphiql-plugin-doc-explorer/src/components/doc-explorer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isType } from 'graphql';
2-
import { FC, ReactNode } from 'react';
2+
import type { FC, ReactNode } from 'react';
33
import { ChevronLeftIcon, Spinner, useGraphiQL, pick } from '@graphiql/react';
44
import { useDocExplorer, useDocExplorerActions } from '../context';
55
import { FieldDocumentation } from './field-documentation';

0 commit comments

Comments
 (0)