Skip to content

Commit f0b3159

Browse files
committed
Config for runtime: automatic
1 parent 628cc5d commit f0b3159

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ module.exports = {
5555
'react/button-has-type': 'off',
5656
'react/no-array-index-key': 'off',
5757
'react/no-unsafe': ['error', {checkAliases: true}],
58+
59+
// These can be removed when eslint-plugin-react is updated
60+
'react/jsx-uses-react': 'off',
61+
'react/react-in-jsx-scope': 'off',
62+
5863
'@shopify/jsx-no-complex-expressions': 'off',
5964
'@shopify/jsx-prefer-fragment-wrappers': 'off',
6065
'@shopify/no-ancestor-directory-import': 'error',
@@ -165,7 +170,6 @@ module.exports = {
165170
files: ['polaris.shopify.com/**/*'],
166171
extends: 'plugin:@next/eslint-plugin-next/recommended',
167172
rules: {
168-
'react/react-in-jsx-scope': 'off',
169173
'@shopify/jsx-no-hardcoded-content': 'off',
170174
'import/no-default-export': 'off',
171175
},

babel.config.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
/**
22
* @type {import('@babel/core').TransformOptions}
33
*/
4-
module.exports = function () {
4+
module.exports = function (api) {
5+
api.cache(true);
6+
57
return {
68
presets: [
79
[
810
'@babel/preset-env',
911
{useBuiltIns: 'entry', corejs: '3.0', bugfixes: true},
1012
],
1113
['@babel/preset-typescript'],
12-
['@babel/preset-react', {runtime: 'automatic', useBuiltIns: true}],
14+
[
15+
'@babel/preset-react',
16+
{
17+
runtime: 'automatic',
18+
useBuiltIns: true,
19+
},
20+
],
1321
],
1422
assumptions: {
1523
setPublicClassFields: true,

polaris-migrator/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"emitDeclarationOnly": true,
77
"outDir": "dist/types",
88
"rootDir": "src",
9-
"jsx": "react",
9+
"jsx": "react-jsx",
1010
"types": ["node", "jest"]
1111
},
1212
"include": ["src"],

polaris-react/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"strictFunctionTypes": false,
1010
"paths": {
1111
"tests/*": ["./tests/*"]
12-
}
12+
},
13+
"jsx": "react-jsx"
1314
},
1415
"include": [
1516
"./src",

polaris.shopify.com/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"moduleResolution": "node",
1616
"resolveJsonModule": true,
1717
"isolatedModules": true,
18-
"jsx": "preserve",
18+
"jsx": "react-jsx",
1919
"composite": true,
2020
"noUnusedLocals": true,
2121
"noUnusedParameters": true

0 commit comments

Comments
 (0)