From 166491d6e4f1ffc715008e7ac56c03d0aafe9a2e Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Sun, 12 Jan 2020 00:45:36 +0900 Subject: [PATCH 1/2] fix: change export syntax for d.ts --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 2f5ec9ed08f7a6567a3f783785718642fc0af1e4 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Sun, 12 Jan 2020 00:54:01 +0900 Subject: [PATCH 2/2] chore: add tsc check to CI --- .circleci/config.yml | 15 +++++++++++++++ package.json | 3 ++- tsconfig.json | 11 +++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tsconfig.json 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/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'. */ + } +}