Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
let presets;
let plugins = [];

try {
require.resolve('module:@react-native/babel-preset');
presets = ['module:@react-native/babel-preset'];
} catch (err) {
presets = [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
];
plugins = ['@babel/plugin-transform-flow-strip-types'];
}

module.exports = {
presets: ['module:@react-native/babel-preset'],
presets,
plugins,
};
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"scripts": {
"example": "yarn workspace react-native-phone-connectivity-example",
"watch-example": "yarn workspace react-native-wear-connectivity-example",
"test": "jest",
"test": "jest --coverage",
"typecheck": "tsc --noEmit",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
Expand Down Expand Up @@ -98,6 +98,11 @@
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
],
"collectCoverage": true,
"collectCoverageFrom": [
"src/**/*.{ts,tsx}",
"!src/**/*.d.ts"
]
},
"commitlint": {
Expand Down
Loading