Commit 369a8d5d authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Adopt babel automatic runtime

parent a65daaca
{ {
"presets": [ "presets": [
["@babel/preset-react", { [
"pragma": "createElement" "@babel/preset-react",
}], {
"runtime": "automatic",
"importSource": "preact"
}
],
// Compile JS for browser targets set by `browserslist` key in package.json. // Compile JS for browser targets set by `browserslist` key in package.json.
["@babel/preset-env", { [
"bugfixes": true "@babel/preset-env",
}] {
"bugfixes": true
}
]
], ],
"plugins": ["inject-args"], "plugins": ["inject-args"],
"ignore": ["**/vendor/*"], "ignore": ["**/vendor/*"],
"env": { "env": {
"development": { "development": {
"presets": [ "presets": [
["@babel/preset-react", { [
"development": true, "@babel/preset-react",
"pragma": "createElement" {
}] "development": true,
"runtime": "automatic",
// Use `preact/compat/jsx-dev-runtime` which is an alias for `preact/jsx-runtime`.
// See https://github.com/preactjs/preact/issues/2974.
"importSource": "preact/compat"
}
]
] ]
} }
} }
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
"no-prototype-builtins": "off", "no-prototype-builtins": "off",
// Handled by Prettier. // Handled by Prettier.
"comma-dangle": "off" "comma-dangle": "off",
// https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#eslint
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
} }
} }
{ {
"presets": [ "presets": [
[ [
"@babel/preset-react", { "@babel/preset-react",
"pragma": "createElement" {
}], "runtime": "automatic",
["@babel/preset-env", { "importSource": "preact"
}
],
[
"@babel/preset-env",
{
"bugfixes": true, "bugfixes": true,
"targets": { "targets": {
"chrome": "57", "chrome": "57",
...@@ -12,15 +17,20 @@ ...@@ -12,15 +17,20 @@
"safari": "10.1", "safari": "10.1",
"edge": "17" "edge": "17"
} }
}] }
]
], ],
"env": { "env": {
"development": { "development": {
"presets": [ "presets": [
["@babel/preset-react", { [
"development": true, "@babel/preset-react",
"pragma": "createElement" {
}] "development": true,
"runtime": "automatic",
"importSource": "preact/compat"
}
]
] ]
} }
} }
......
...@@ -3,23 +3,20 @@ ...@@ -3,23 +3,20 @@
"allowJs": true, "allowJs": true,
"checkJs": true, "checkJs": true,
"lib": ["es2018", "dom"], "lib": ["es2018", "dom"],
"jsx": "react", "jsx": "react-jsx",
"jsxFactory": "createElement", "jsxImportSource": "preact",
"module": "commonjs", "module": "commonjs",
"noEmit": true, "noEmit": true,
"strict": true, "strict": true,
"noImplicitAny": false, "noImplicitAny": false,
"target": "ES2020" "target": "ES2020"
}, },
"include": [ "include": ["**/*.js", "../frontend-shared/src/**/*.js"],
"**/*.js",
"../frontend-shared/src/**/*.js",
],
"exclude": [ "exclude": [
// Tests are not checked. // Tests are not checked.
"**/test/**/*.js", "**/test/**/*.js",
"test-util/**/*.js", "test-util/**/*.js",
"karma.config.js", "karma.config.js",
"../frontend-shared/src/**/test/*.js", "../frontend-shared/src/**/test/*.js"
] ]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment