Skip to content

Commit 8238a62

Browse files
philibeachambo-e
andauthored
feat(react): new automatic runtime (#695)
* feat(react): new automatic runtime * fix: remove useless plugin * fix: remove eslint override * fix: remove file Co-authored-by: Emmanuel Chambon <[email protected]>
1 parent f578985 commit 8238a62

File tree

17 files changed

+30
-18
lines changed

17 files changed

+30
-18
lines changed

.eslintrc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@
1212
{
1313
"devDependencies": ["**/__tests__/*", "rollup.config.mjs"]
1414
}
15-
]
15+
],
16+
"react/jsx-uses-react": "off",
17+
"react/react-in-jsx-scope": "off"
1618
},
1719
"overrides": [
1820
{
1921
"files": ["*.ts", "*.tsx"],
2022
"parserOptions": {
2123
"project": ["tsconfig.json"]
2224
},
23-
"extends": ["./packages/eslint-config-react/typescript.js"]
25+
"extends": ["./packages/eslint-config-react/typescript.js"],
26+
"rules": {
27+
"react/jsx-uses-react": "off",
28+
"react/react-in-jsx-scope": "off"
29+
}
2430
}
2531
]
2632
}

babel.config.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"presets": [
33
"@babel/preset-env",
4-
"@babel/preset-react",
4+
[
5+
"@babel/preset-react",
6+
{
7+
"runtime": "automatic"
8+
}
9+
],
510
["@babel/preset-typescript", { "allowDeclareFields": true }]
611
],
712
"plugins": ["@babel/plugin-transform-runtime"]

packages/jest-helpers/src/__tests__/index.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from 'react'
21
import makeHelpers from '..'
32
import { RenderWithThemeFn } from '../helpers/renderWithTheme'
43
import { ShouldMatchEmotionSnapshotFn } from '../helpers/shouldMatchEmotionSnapshot'

packages/jest-helpers/src/helpers/renderWithTheme.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import createCache from '@emotion/cache'
22
import { CacheProvider } from '@emotion/react'
33
import { RenderOptions, render } from '@testing-library/react'
4-
import React, { FC, ReactNode } from 'react'
4+
import { FC, ReactNode } from 'react'
55

66
const emotionCache = createCache({
77
key: 'cache',

packages/use-dataloader/.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ module.exports = {
55
'import/no-extraneous-dependencies': [
66
'error',
77
{ packageDir: [__dirname, join(__dirname, '../../')] }
8-
]
8+
],
99
}
1010
};

packages/use-dataloader/src/DataLoaderProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import PropTypes from 'prop-types'
2-
import React, {
2+
import {
33
ReactElement,
44
ReactNode,
55
createContext,

packages/use-dataloader/src/__tests__/DataLoaderProvider.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen } from '@testing-library/react'
22
import { act, renderHook } from '@testing-library/react-hooks'
3-
import React, { ReactNode } from 'react'
3+
import { ReactNode } from 'react'
44
import DataLoaderProvider, { useDataLoaderContext } from '../DataLoaderProvider'
55
import { KEY_IS_NOT_STRING_ERROR, StatusEnum } from '../constants'
66

packages/use-dataloader/src/__tests__/useDataLoader.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { act, renderHook } from '@testing-library/react-hooks'
2-
import React from 'react'
32
import DataLoaderProvider, { useDataLoaderContext } from '../DataLoaderProvider'
43
import { KEY_IS_NOT_STRING_ERROR } from '../constants'
54
import { PromiseType, UseDataLoaderConfig, UseDataLoaderResult } from '../types'

packages/use-dataloader/src/__tests__/usePaginatedDataLoader.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { act } from '@testing-library/react'
22
import { renderHook } from '@testing-library/react-hooks'
3-
import React from 'react'
43
import DataLoaderProvider from '../DataLoaderProvider'
54
import { KEY_IS_NOT_STRING_ERROR } from '../constants'
65
import {

packages/use-i18n/.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ module.exports = {
55
'import/no-extraneous-dependencies': [
66
'error',
77
{ packageDir: [__dirname, join(__dirname, '../../')] }
8-
]
8+
],
99
}
1010
};

0 commit comments

Comments
 (0)