Skip to content

Commit 66f1152

Browse files
authored
Use babel for typescript compilation with minimal changes (#1738)
1 parent 4c471b0 commit 66f1152

File tree

6 files changed

+1043
-28111
lines changed

6 files changed

+1043
-28111
lines changed

.babelrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const cjs = NODE_ENV === 'test' || BABEL_ENV === 'commonjs'
33
const loose = true
44

55
module.exports = {
6-
presets: [['@babel/env', { loose, modules: false }]],
6+
presets: [['@babel/env', { loose, modules: false }], '@babel/preset-typescript'],
77
plugins: [
88
['@babel/proposal-decorators', { legacy: true }],
99
['@babel/proposal-object-rest-spread', { loose }],
@@ -18,5 +18,5 @@ module.exports = {
1818
].replace(/^[^0-9]*/, '')
1919
}
2020
]
21-
].filter(Boolean)
21+
].filter(Boolean),
2222
}

.eslintrc

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"parser": "babel-eslint",
2+
"parser": "@typescript-eslint/parser",
33
"extends": [
44
"eslint:recommended",
55
"plugin:import/recommended",
66
"plugin:react/recommended",
77
"plugin:prettier/recommended"
8+
// "plugin:@typescript-eslint/recommended"
89
],
910
"settings": {
1011
"react": {
1112
"version": "detect"
13+
},
14+
"import/resolver": {
15+
"node": {
16+
"extensions": [".js", ".ts"]
17+
}
1218
}
1319
},
1420
"parserOptions": {
@@ -32,6 +38,7 @@
3238
"react/no-string-refs": 0
3339
},
3440
"plugins": [
41+
"@typescript-eslint",
3542
"import",
3643
"react"
3744
]

0 commit comments

Comments
 (0)