Skip to content

Commit

Permalink
use classic jsx transform in plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheyenbrock committed Feb 7, 2023
1 parent 526f69f commit 48bc48d
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ module.exports = {

'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
{
varsIgnorePattern: '^React$',
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],

'no-use-before-define': 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-code-exporter/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { GraphiQLPlugin } from '@graphiql/react';
import { useMemo, useRef } from 'react';
import React, { useMemo, useRef } from 'react';
import GraphiQLCodeExporter, {
GraphiQLCodeExporterProps,
} from 'graphiql-code-exporter';
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-code-exporter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"isolatedModules": true,
"declaration": true,
"declarationDir": "types",
"jsx": "react-jsx"
"jsx": "react"
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-code-exporter/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react({ jsxRuntime: 'classic' })],
build: {
lib: {
entry: 'src/index.tsx',
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-explorer/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
useSchemaContext,
} from '@graphiql/react';
import GraphiQLExplorer, { GraphiQLExplorerProps } from 'graphiql-explorer';
import { useMemo, useRef } from 'react';
import React, { useMemo, useRef } from 'react';

import './graphiql-explorer.d.ts';
import './index.css';
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-explorer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"isolatedModules": true,
"declaration": true,
"declarationDir": "types",
"jsx": "react-jsx"
"jsx": "react"
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
Expand Down
2 changes: 1 addition & 1 deletion packages/graphiql-plugin-explorer/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import react from '@vitejs/plugin-react';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react({ jsxRuntime: 'classic' })],
build: {
lib: {
entry: 'src/index.tsx',
Expand Down

0 comments on commit 48bc48d

Please sign in to comment.