From 06cd90562d31c89bdb3bdf2ff761797ecb0be773 Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Mon, 23 Mar 2020 05:28:19 -0700 Subject: [PATCH] Re-use base tsconfig options Summary: Added tsconfig.base.json and extend other tsconfigs from it. Reviewed By: passy Differential Revision: D20594653 fbshipit-source-id: 28dd80262613e78a7c4ce25fa31f251537ec2b06 --- desktop/.gitignore | 3 +++ desktop/doctor/.gitignore | 2 -- desktop/doctor/package.json | 2 +- desktop/doctor/tsconfig.json | 10 +++------- desktop/pkg/.eslintignore | 1 - desktop/pkg/.gitignore | 2 -- desktop/pkg/package.json | 2 +- desktop/pkg/tsconfig.json | 13 +++---------- desktop/tsconfig.base.json | 16 ++++++++++++++++ desktop/tsconfig.json | 26 ++++++++++++-------------- 10 files changed, 39 insertions(+), 38 deletions(-) create mode 100644 desktop/.gitignore delete mode 100644 desktop/doctor/.gitignore delete mode 100644 desktop/pkg/.eslintignore delete mode 100644 desktop/pkg/.gitignore create mode 100644 desktop/tsconfig.base.json diff --git a/desktop/.gitignore b/desktop/.gitignore new file mode 100644 index 000000000..6cf8928fa --- /dev/null +++ b/desktop/.gitignore @@ -0,0 +1,3 @@ +lib/ +node_modules/ +*.tsbuildinfo diff --git a/desktop/doctor/.gitignore b/desktop/doctor/.gitignore deleted file mode 100644 index 97dba69de..000000000 --- a/desktop/doctor/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/lib -node_modules/ diff --git a/desktop/doctor/package.json b/desktop/doctor/package.json index 3d14572e8..300512352 100644 --- a/desktop/doctor/package.json +++ b/desktop/doctor/package.json @@ -24,7 +24,7 @@ "typescript": "^3.7.2" }, "scripts": { - "build": "tsc", + "build": "tsc -b", "prepare": "yarn run build", "prepublishOnly": "yarn test && yarn run lint", "preversion": "yarn run lint", diff --git a/desktop/doctor/tsconfig.json b/desktop/doctor/tsconfig.json index bea878cbc..2fb289f45 100644 --- a/desktop/doctor/tsconfig.json +++ b/desktop/doctor/tsconfig.json @@ -1,12 +1,8 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "lib": ["es7", "dom", "es2017"], - "target": "es5", - "module": "commonjs", - "declaration": true, - "outDir": "./lib", - "strict": true, - "skipLibCheck": true + "outDir": "lib", + "rootDir": "src" }, "include": ["src"], "exclude": ["node_modules", "**/__tests__/*"] diff --git a/desktop/pkg/.eslintignore b/desktop/pkg/.eslintignore deleted file mode 100644 index 502167fa0..000000000 --- a/desktop/pkg/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -/lib diff --git a/desktop/pkg/.gitignore b/desktop/pkg/.gitignore deleted file mode 100644 index 21bd127bf..000000000 --- a/desktop/pkg/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/lib -/node_modules/ diff --git a/desktop/pkg/package.json b/desktop/pkg/package.json index 0c5acaee7..943ad90f1 100644 --- a/desktop/pkg/package.json +++ b/desktop/pkg/package.json @@ -46,7 +46,7 @@ "typescript": "^3.7.2" }, "scripts": { - "build": "tsc", + "build": "tsc -b", "postpack": "rm -f oclif.manifest.json", "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme", "prepare": "yarn run build", diff --git a/desktop/pkg/tsconfig.json b/desktop/pkg/tsconfig.json index 62a5a4f51..2a2b1f404 100644 --- a/desktop/pkg/tsconfig.json +++ b/desktop/pkg/tsconfig.json @@ -1,17 +1,10 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "es2017", - "module": "commonjs", - "declaration": true, "outDir": "lib", "rootDir": "src", - "strict": true, - "importHelpers": true, - "esModuleInterop": true, - "skipLibCheck": true, "allowJs": true }, - "include": [ - "src/**/*" - ] + "include": ["src"], + "exclude": ["node_modules", "**/__tests__/*"] } diff --git a/desktop/tsconfig.base.json b/desktop/tsconfig.base.json new file mode 100644 index 000000000..c7ace6d4a --- /dev/null +++ b/desktop/tsconfig.base.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es7", "dom", "es2017"], + "esModuleInterop": true, + "target": "ES2017", + "removeComments": true, + "preserveConstEnums": true, + "sourceMap": true, + "jsx": "react", + "moduleResolution": "node", + "skipLibCheck": true, + "strict": true, + "incremental": true + } +} diff --git a/desktop/tsconfig.json b/desktop/tsconfig.json index 705bcb413..167217e7e 100644 --- a/desktop/tsconfig.json +++ b/desktop/tsconfig.json @@ -1,25 +1,23 @@ { + "extends": "./tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "lib": ["es7", "dom", "es2017"], - "esModuleInterop": true, - "target": "es6", - "removeComments": true, - "preserveConstEnums": true, - "sourceMap": true, - "jsx": "react", - "moduleResolution": "node", "baseUrl": ".", - "downlevelIteration": true, - "skipLibCheck": true, "paths": { "flipper": ["./app/src"], "flipper-doctor": ["./doctor/src"], "flipper-pkg": ["./pkg/src"], "live-plugin-manager": ["./types/live-plugin-manager.d.tsx"] - }, - "strict": true + } }, - "include": ["src/**/*", "doctor/**/*", "pkg/**/*", "static/**/*", "scripts/**/*", "types/**/*", "headless/**/*", "plugins/**/*"], + "include": [ + "src/**/*", + "doctor/**/*", + "pkg/**/*", + "static/**/*", + "scripts/**/*", + "types/**/*", + "headless/**/*", + "plugins/**/*" + ], "exclude": ["node_modules", "**/*.spec.ts"] }