diff --git a/.circleci/config.yml b/.circleci/config.yml index da69daa04..2a8d8117a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,10 @@ aliases: name: Lint command: yarn lint + - &tsc + name: TypeScript type check + command: yarn test:tsc + # ------------------------- # DEFAULTS # ------------------------- @@ -100,6 +104,14 @@ jobs: at: ~/react-native-push-notification-ios - run: *eslint + tsc: + <<: *js_defaults + steps: + - attach_workspace: + at: ~/react-native-push-notification-ios + - run: *tsc + + # ------------------------- # WORK FLOWS # ------------------------- @@ -117,3 +129,6 @@ workflows: - lint: requires: - checkout-code + - tsc: + requires: + - checkout-code diff --git a/index.d.ts b/index.d.ts index 5edf5127a..0075141c9 100644 --- a/index.d.ts +++ b/index.d.ts @@ -261,4 +261,4 @@ export interface PushNotificationIOSStatic { declare const PushNotificationIOS: PushNotificationIOSStatic; -export = PushNotificationIOS; +export default PushNotificationIOS; diff --git a/package.json b/package.json index 8d88bac5f..bcf314564 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "test": "yarn test:flow && yarn test:js", "test:flow": "flow check", "test:js": "echo 0", - "lint": "eslint ." + "lint": "eslint .", + "test:tsc":"tsc --noEmit" }, "keywords": [ "react-native", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..dfcb17f35 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + /* Basic Options */ + "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "noEmit": true, + /* Strict Type-Checking Options */ + "strict": true, /* Enable all strict type-checking options. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + } +}