Skip to content

Commit

Permalink
Upgrade to Typescript (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Alden Barry authored and larixer committed Dec 12, 2019
1 parent 387c9ee commit d54cb02
Show file tree
Hide file tree
Showing 83 changed files with 1,591 additions and 1,071 deletions.
6 changes: 3 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"transform-regenerator"
]
}
]
],
["@babel/preset-typescript"]
],
"plugins": [
"@babel/plugin-transform-flow-strip-types",
[
"@babel/plugin-proposal-decorators",
"@babel/plugin-proposal-decorators",
{
"decoratorsBeforeExport": false
}
Expand Down
15 changes: 2 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
{
"parser": "babel-eslint",
"extends": [
"airbnb-base",
"plugin:flowtype/recommended"
],
"plugins": [
"flowtype",
"flowtype-errors"
"airbnb-base"
],
"env": {
"node": true
},
"settings": {
"flowtype": {
"onlyFilesWithFlowAnnotation": true
}
},
"rules": {
"arrow-parens": ["error", "always"],
"max-len": ["error", 120],
"no-duplicate-imports": "off",
"no-restricted-syntax": "off",
"generator-star-spacing": "off",
"import/no-extraneous-dependencies": ["error", {"peerDependencies": true}],
"flowtype-errors/show-errors": "error"
"import/no-extraneous-dependencies": ["error", {"peerDependencies": true}]
}
}
5 changes: 0 additions & 5 deletions .flowconfig

This file was deleted.

4 changes: 2 additions & 2 deletions examples/debug-webpack4/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
let config = {
mode: process.env.NODE_ENV || 'development',
entry: './src/index.js',
entry: './lib/index.js',
devServer: {
contentBase: './src'
contentBase: './lib'
}
};

Expand Down
27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
"scripts": {
"clean-lib": "del-cli \"lib/**\" \"!lib\" \"!lib/reporters\" \"!lib/utils.js\" \"!lib/entry.js\" \"!lib/reporters/base.js\"",
"clean-tmp": "del-cli \".tmp/**\"",
"build": "yarn run clean-lib && babel ./src -d lib --source-maps",
"build": "yarn run clean-lib && tsc",
"lint": "eslint src test bin --fix",
"flow": "flow",
"test": "yarn run clean-tmp && yarn run build && mocha --timeout 10000 --recursive --require @babel/register \"test/**/*.test.js\"",
"test": "yarn run clean-tmp && yarn run build && ts-mocha --timeout 10000 --recursive --require @babel/register --exit \"test/**/*.test.ts\"",
"cover": "cross-env BABEL_ENV=coverage nyc --reporter=lcov --reporter=text npm test",
"posttest": "yarn run lint",
"docs:clean": "del-cli _book",
Expand All @@ -31,7 +30,7 @@
"prepublishOnly": "yarn run build && yarn run docs:build",
"postpublish": "yarn run docs:deploy",
"release": "np",
"watch": "babel ./src -w -d lib"
"watch": "tsc -w"
},
"repository": {
"type": "git",
Expand All @@ -56,11 +55,14 @@
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-typescript": "^7.7.4",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.7.6",
"@types/lodash": "^4.14.149",
"@types/node": "^12.12.17",
"@types/webpack": "^4.41.0",
"anymatch": "3.1.1",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.0",
Expand All @@ -75,11 +77,7 @@
"del-cli": "3.0.0",
"eslint": "4.19.1",
"eslint-config-airbnb-base": "12.1.0",
"eslint-plugin-flowtype": "4.3.0",
"eslint-plugin-flowtype-errors": "4.1.0",
"eslint-plugin-import": "^2.9.0",
"fast-async": "^6.1.2",
"flow-bin": "^0.113.0",
"fs-extra": "5.0.0",
"gh-pages": "1.2.0",
"gitbook-cli": "^2.3.2",
Expand All @@ -96,6 +94,8 @@
"sinon": "7.5.0",
"strip-ansi": "^5.2.0",
"tiny-worker": "2.3.0",
"ts-mocha": "^6.0.0",
"typescript": "^3.7.3",
"webpack": "4.41.0",
"worker-loader": "2.0.0",
"write-file-webpack-plugin": "^4.2.0"
Expand Down Expand Up @@ -130,11 +130,10 @@
]
},
"nyc": {
"extension": [".ts"],
"include": [
"src/**/*.js"
],
"sourceMap": false,
"instrument": false
"src/**/*.ts"
]
},
"resolutions": {
"js-yaml": ">=3.13.0",
Expand Down
Loading

0 comments on commit d54cb02

Please sign in to comment.