Skip to content

Commit

Permalink
Config for runtime: automatic
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-page committed Mar 13, 2023
1 parent 628cc5d commit f0b3159
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ module.exports = {
'react/button-has-type': 'off',
'react/no-array-index-key': 'off',
'react/no-unsafe': ['error', {checkAliases: true}],

// These can be removed when eslint-plugin-react is updated
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',

'@shopify/jsx-no-complex-expressions': 'off',
'@shopify/jsx-prefer-fragment-wrappers': 'off',
'@shopify/no-ancestor-directory-import': 'error',
Expand Down Expand Up @@ -165,7 +170,6 @@ module.exports = {
files: ['polaris.shopify.com/**/*'],
extends: 'plugin:@next/eslint-plugin-next/recommended',
rules: {
'react/react-in-jsx-scope': 'off',
'@shopify/jsx-no-hardcoded-content': 'off',
'import/no-default-export': 'off',
},
Expand Down
12 changes: 10 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
/**
* @type {import('@babel/core').TransformOptions}
*/
module.exports = function () {
module.exports = function (api) {
api.cache(true);

return {
presets: [
[
'@babel/preset-env',
{useBuiltIns: 'entry', corejs: '3.0', bugfixes: true},
],
['@babel/preset-typescript'],
['@babel/preset-react', {runtime: 'automatic', useBuiltIns: true}],
[
'@babel/preset-react',
{
runtime: 'automatic',
useBuiltIns: true,
},
],
],
assumptions: {
setPublicClassFields: true,
Expand Down
2 changes: 1 addition & 1 deletion polaris-migrator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"emitDeclarationOnly": true,
"outDir": "dist/types",
"rootDir": "src",
"jsx": "react",
"jsx": "react-jsx",
"types": ["node", "jest"]
},
"include": ["src"],
Expand Down
3 changes: 2 additions & 1 deletion polaris-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"strictFunctionTypes": false,
"paths": {
"tests/*": ["./tests/*"]
}
},
"jsx": "react-jsx"
},
"include": [
"./src",
Expand Down
2 changes: 1 addition & 1 deletion polaris.shopify.com/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"composite": true,
"noUnusedLocals": true,
"noUnusedParameters": true
Expand Down

0 comments on commit f0b3159

Please sign in to comment.