Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
369a8d5d
Commit
369a8d5d
authored
Feb 04, 2021
by
Eduardo Sanz García
Committed by
Eduardo
Feb 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adopt babel automatic runtime
parent
a65daaca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
27 deletions
+51
-27
.babelrc
.babelrc
+23
-10
.eslintrc
.eslintrc
+5
-1
babel.config.json
frontend-shared/babel.config.json
+19
-9
tsconfig.json
src/tsconfig.json
+4
-7
No files found.
.babelrc
View file @
369a8d5d
{
{
"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"
}
]
]
]
}
}
}
}
...
...
.eslintrc
View file @
369a8d5d
...
@@ -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"
}
}
}
}
frontend-shared/babel.config.json
View file @
369a8d5d
{
{
"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"
}
]
]
]
}
}
}
}
...
...
src/tsconfig.json
View file @
369a8d5d
...
@@ -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
"
,
"jsx
Factory"
:
"createElemen
t"
,
"jsx
ImportSource"
:
"preac
t"
,
"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"
]
]
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment