add typescript support (#64)
* add typescript support * remove typescript extend from eslint-config-mattermost
This commit is contained in:
parent
aac26c1068
commit
3475ff3c9d
6 changed files with 434 additions and 17 deletions
|
@ -9,12 +9,12 @@ module.exports = {
|
|||
'src',
|
||||
'node_modules',
|
||||
],
|
||||
extensions: ['*', '.js', '.jsx'],
|
||||
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
test: /\.(js|jsx|ts|tsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
|
@ -22,6 +22,8 @@ module.exports = {
|
|||
plugins: [
|
||||
'@babel/plugin-proposal-class-properties',
|
||||
'@babel/plugin-syntax-dynamic-import',
|
||||
'@babel/proposal-object-rest-spread',
|
||||
'babel-plugin-typescript-to-proptypes',
|
||||
],
|
||||
presets: [
|
||||
['@babel/preset-env', {
|
||||
|
@ -39,6 +41,10 @@ module.exports = {
|
|||
['@babel/preset-react', {
|
||||
useBuiltIns: true,
|
||||
}],
|
||||
['@babel/typescript', {
|
||||
allExtensions: true,
|
||||
isTSX: true,
|
||||
}]
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
Reference in a new issue