From 81eb4804e570627b703da7fa28f289453354f8b2 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Sun, 15 Aug 2021 21:01:53 +0200 Subject: [PATCH] Add configuration for global typings (#2) Support for https://github.com/flarum/core/pull/2992 --- js-packages/tsconfig/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js-packages/tsconfig/README.md b/js-packages/tsconfig/README.md index f65d2ab35..1416fac50 100644 --- a/js-packages/tsconfig/README.md +++ b/js-packages/tsconfig/README.md @@ -19,8 +19,10 @@ A baseline `tsconfig.json` is provided below that you can modify as needed. This { // Use Flarum's tsconfig as a starting point "extends": "flarum-tsconfig", - // This will match all .ts, .tsx, .d.ts, .js, .jsx files - "include": ["src/**/*"], + // This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder + // and also tells your Typescript server to read core's global typings for + // access to `dayjs` and `$` in the global namespace. + "include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*"], "compilerOptions": { // This will output typings to `dist-typings` "declarationDir": "./dist-typings",