Skip to content

Commit

Permalink
Add TypeScript support (#8)
Browse files Browse the repository at this point in the history
* add typescript configuration

* remove package-lock.json

(cherry picked from commit 7137175)
  • Loading branch information
mateuszpmroz authored and mdfkbtc committed Apr 13, 2020
1 parent 9531683 commit 4e1b450
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 3 deletions.
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
moduleDirectories: ['node_modules', 'src'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx' ],
preset: 'react-native',
setupFilesAfterEnv: ['./tests/setup.js'],
testPathIgnorePatterns: ['/node_modules/'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
transformIgnorePatterns: [
'node_modules/(?!(jest-)?react-native|react-navigation)',
],
coveragePathIgnorePatterns: ['/node_modules/'],
};
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
"version": "4.8.2",
"devDependencies": {
"@babel/core": "^7.5.0",
"@babel/preset-flow": "^7.9.0",
"@babel/runtime": "^7.5.1",
"@react-native-community/eslint-config": "^0.0.5",
"@types/jest": "^25.1.4",
"@types/react": "^16.9.31",
"@types/react-native": "^0.62.1",
"@types/react-test-renderer": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^2.26.0",
"@typescript-eslint/parser": "^2.26.0",
"babel-cli": "^6.26.0",
"babel-eslint": "^10.0.2",
"babel-jest": "^24.8.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-babel": "^5.3.0",
Expand Down Expand Up @@ -51,6 +54,7 @@
]
},
"dependencies": {
"@babel/cli": "^7.8.4",
"@babel/preset-env": "7.5.0",
"@react-native-community/async-storage": "1.7.1",
"@react-native-community/blur": "3.3.1",
Expand Down Expand Up @@ -127,7 +131,7 @@
"readable-stream": "3.4.0",
"secure-random": "1.1.2",
"stream-browserify": "2.0.2",
"uglify-es": "^3.3.9",
"typescript": "^3.8.3",
"url": "0.11.0",
"util": "0.12.1",
"wif": "2.0.6"
Expand Down
24 changes: 24 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"jsx": "react-native",
"noEmit": true,
"allowJs": true,
"strict": true,
"suppressImplicitAnyIndexErrors": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"isolatedModules": true,
"lib": ["esnext"],
"resolveJsonModule": true,
"noImplicitAny": true,
"strictNullChecks": true,
},
"exclude": [
"node_modules",
"babel.config.js",
"jest.config.js"
]
}

0 comments on commit 4e1b450

Please sign in to comment.