From 98b429f941ee725fa9fca1a711ff34a9e124c032 Mon Sep 17 00:00:00 2001 From: Eldritch-Oliver Date: Sun, 5 Oct 2025 13:31:31 -0600 Subject: [PATCH] Finish making the intellisense work properly --- augments.d.ts | 14 ++++++++++++++ eslint.config.mjs | 2 +- jsconfig.json | 22 +++++++++++++++------- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 augments.d.ts diff --git a/augments.d.ts b/augments.d.ts new file mode 100644 index 0000000..dc091c2 --- /dev/null +++ b/augments.d.ts @@ -0,0 +1,14 @@ +declare global { + class Hooks extends foundry.helpers.Hooks {}; + const fromUuid = foundry.utils.fromUuid; +} + +interface Actor { + /** The system-specific data */ + system: any; +}; + +interface Item { + /** The system-specific data */ + system: any; +}; \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs index a0d500d..c18baac 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -4,7 +4,7 @@ import stylistic from "@stylistic/eslint-plugin"; export default [ // Tell eslint to ignore files that I don't mind being formatted slightly differently - { ignores: [ `scripts/` ] }, + { ignores: [ `scripts/`, `foundry/` ] }, { languageOptions: { globals: globals.browser, diff --git a/jsconfig.json b/jsconfig.json index 8b0d1fc..47b5b55 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,11 +1,19 @@ { "compilerOptions": { - "module": "ES2020", - "target": "ES2020" + "module": "es2022", + "target": "es2022", + "types": [ + "./augments.d.ts" + ], + "paths": { + "@client/*": ["./foundry/client/*"], + "@common/*": ["./foundry/common/*"], + } }, - "exclude": ["node_modules", "**/node_modules/*"], - "include": ["module/**/*", "foundry.v13.link/client/**/*.js", "foundry.v13.link/**/*.mjs"], - "typeAcquisition": { - "include": ["jquery"] - } + "include": [ + "module/**/*", + "foundry/client/client.mjs", + "foundry/client/global.d.mts", + "foundry/common/primitives/global.d.mts" + ] } \ No newline at end of file