diff --git a/typings/custom-global/tsconfig.json b/typings/custom-global/tsconfig.json new file mode 100644 index 0000000000000..c6f8b0a935c4c --- /dev/null +++ b/typings/custom-global/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": {}, + "include": ["*.d.ts"] +} diff --git a/typings/environment/index.d.ts b/typings/environment/index.d.ts index 95fcb368619e3..dfa3fa0c146df 100644 --- a/typings/environment/index.d.ts +++ b/typings/environment/index.d.ts @@ -8,9 +8,14 @@ declare namespace NodeJS { }; } - // @ts-ignore - ignore type checking on `/typings` package scope, because `@types/webpack-env` defines `env` as `any`, - // thus making extension incompatible. - // - `@types/webpack-env` leaks here because we override `@storybook/addons` module type definitions which internally reference `@types/webpack-env` + /** + * NOTE: + * proper DX and type-checking wont work whenever a library that uses `@types/webpack-env` is used in your code. + * + * WHY?: + * - `@types/webpack-env` defines `env` as `any`, thus making extension incompatible. @see https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webpack-env/index.d.ts#L275 + * - `@storybook/addons` module type definitions internally reference `@types/webpack-env` so `process.env` type checking/DX wont work in all storybook configs/files + */ export interface ProcessEnv extends ExtendedProcessEnv {} } diff --git a/typings/environment/tsconfig.json b/typings/environment/tsconfig.json new file mode 100644 index 0000000000000..c6f8b0a935c4c --- /dev/null +++ b/typings/environment/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": {}, + "include": ["*.d.ts"] +} diff --git a/typings/inline-style-expand-shorthand/tsconfig.json b/typings/inline-style-expand-shorthand/tsconfig.json new file mode 100644 index 0000000000000..c6f8b0a935c4c --- /dev/null +++ b/typings/inline-style-expand-shorthand/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": {}, + "include": ["*.d.ts"] +} diff --git a/typings/package.json b/typings/package.json index 047fb7790d794..89a4daf362b5e 100644 --- a/typings/package.json +++ b/typings/package.json @@ -3,6 +3,6 @@ "version": "0.0.1", "private": true, "scripts": { - "type-check": "tsc -p ./tsconfig.json" + "type-check": "tsc -b ./tsconfig.json" } } diff --git a/typings/static-assets/tsconfig.json b/typings/static-assets/tsconfig.json new file mode 100644 index 0000000000000..c6f8b0a935c4c --- /dev/null +++ b/typings/static-assets/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": {}, + "include": ["*.d.ts"] +} diff --git a/typings/storybook__addons/tsconfig.json b/typings/storybook__addons/tsconfig.json new file mode 100644 index 0000000000000..c6f8b0a935c4c --- /dev/null +++ b/typings/storybook__addons/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": {}, + "include": ["*.d.ts"] +} diff --git a/typings/tsconfig.json b/typings/tsconfig.json index 09dbb75ffe7ba..0a88e84ff823f 100644 --- a/typings/tsconfig.json +++ b/typings/tsconfig.json @@ -7,5 +7,23 @@ "noEmit": true, "types": [] }, - "include": ["**/*.d.ts"] + "include": [], + "files": [], + "references": [ + { + "path": "./environment/tsconfig.json" + }, + { + "path": "./static-assets/tsconfig.json" + }, + { + "path": "./inline-style-expand-shorthand/tsconfig.json" + }, + { + "path": "./storybook__addons/tsconfig.json" + }, + { + "path": "./custom-global/tsconfig.json" + } + ] }