diff --git a/.eslintrc.js b/.eslintrc.js index 2394e895bc4..c7be978361f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -32,6 +32,7 @@ module.exports = { 'plugin:import/typescript', 'plugin:react/recommended', 'plugin:react-hooks/recommended', + 'plugin:react/jsx-runtime', 'prettier', ], @@ -221,24 +222,13 @@ module.exports = { 'react/jsx-curly-brace-presence': 'error', 'react/jsx-boolean-value': 'error', 'react/jsx-handler-names': 'error', - 'react/jsx-key': 'error', - 'react/jsx-no-duplicate-props': 'error', - 'react/jsx-no-undef': 'error', 'react/jsx-pascal-case': 'error', - 'react/jsx-uses-react': 'error', - 'react/jsx-uses-vars': 'error', - 'react/no-deprecated': 'error', 'react/no-did-mount-set-state': 'error', 'react/no-did-update-set-state': 'error', - 'react/no-direct-mutation-state': 'error', - 'react/no-string-refs': 'error', - 'react/no-unknown-property': 'error', 'react/prop-types': 0, 'react/prefer-es6-class': 'error', 'react/prefer-stateless-function': 'error', - 'react/react-in-jsx-scope': 'error', 'react/self-closing-comp': 'error', - 'react/display-name': 'warn', 'react/jsx-no-useless-fragment': 'error', 'react/jsx-filename-extension': [ 'error', diff --git a/examples/graphiql-parcel/src/index.tsx b/examples/graphiql-parcel/src/index.tsx index 08bbf0539ab..d21c3c8fbee 100644 --- a/examples/graphiql-parcel/src/index.tsx +++ b/examples/graphiql-parcel/src/index.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import ReactDOM from 'react-dom'; import { GraphiQL } from 'graphiql'; diff --git a/examples/graphiql-parcel/tsconfig.json b/examples/graphiql-parcel/tsconfig.json index b760a1ab436..e33621994a7 100644 --- a/examples/graphiql-parcel/tsconfig.json +++ b/examples/graphiql-parcel/tsconfig.json @@ -14,7 +14,7 @@ "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, - "jsx": "react" + "jsx": "react-jsx" }, "include": ["src"] } diff --git a/packages/graphiql-plugin-code-exporter/.eslintrc b/packages/graphiql-plugin-code-exporter/.eslintrc deleted file mode 100644 index 98f785433f6..00000000000 --- a/packages/graphiql-plugin-code-exporter/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["plugin:react/jsx-runtime"] -} diff --git a/packages/graphiql-plugin-explorer/.eslintrc b/packages/graphiql-plugin-explorer/.eslintrc deleted file mode 100644 index 98f785433f6..00000000000 --- a/packages/graphiql-plugin-explorer/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["plugin:react/jsx-runtime"] -} diff --git a/packages/graphiql-react/.eslintrc b/packages/graphiql-react/.eslintrc deleted file mode 100644 index 98f785433f6..00000000000 --- a/packages/graphiql-react/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["plugin:react/jsx-runtime"] -} diff --git a/packages/graphiql/__mocks__/@graphiql/react.tsx b/packages/graphiql/__mocks__/@graphiql/react.tsx index 8af01a21d7f..f94190e49c6 100644 --- a/packages/graphiql/__mocks__/@graphiql/react.tsx +++ b/packages/graphiql/__mocks__/@graphiql/react.tsx @@ -9,7 +9,7 @@ import { useResponseEditor as _useResponseEditor, useVariableEditor as _useVariableEditor, } from '@graphiql/react'; -import React, { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; export { Argument,