Skip to content

Commit

Permalink
Turn on strictFunctionTypes and noImplicitReturns
Browse files Browse the repository at this point in the history
  • Loading branch information
stwlam committed May 22, 2021
1 parent 69d162f commit 69b7e71
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
40 changes: 19 additions & 21 deletions .betterer.results
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ exports[`stricter compilation`] = {
[503, 28, 23, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'Abilities\'.\\n No index signature with a parameter of type \'string\' was found on type \'Abilities\'.", "1182846011"],
[552, 36, 31, "Element implicitly has an \'any\' type because expression of type \'ItemTrait\' can\'t be used to index type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.\\n Property \'open\' does not exist on type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.", "3601740505"]
],
"src/module/actor/sheet/base.ts:4225340196": [
"src/module/actor/sheet/base.ts:3370367323": [
[201, 61, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ aberration: string; acid: string; aeon: string; aesir: string; agathion: string; air: string; alchemical: string; amphibious: string; anadi: string; angel: string; animal: string; aquatic: string; ... 139 more ...; tiefling: string; } | { ...; } | { ...; } | { ...; } | { ...; }\'.", "3465888121"],
[211, 57, 14, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ aberration: string; acid: string; aeon: string; aesir: string; agathion: string; air: string; alchemical: string; amphibious: string; anadi: string; angel: string; animal: string; aquatic: string; ... 139 more ...; tiefling: string; } | { ...; } | { ...; } | { ...; } | { ...; }\'.", "1791672911"],
[729, 31, 121, "Argument of type \'(elem: HTMLElement) => void\' is not assignable to parameter of type \'(value: Element, index: number, array: Element[]) => void\'.\\n Types of parameters \'elem\' and \'value\' are incompatible.\\n Type \'Element\' is missing the following properties from type \'HTMLElement\': accessKey, accessKeyLabel, autocapitalize, dir, and 107 more.", "455573166"],
[732, 31, 124, "Argument of type \'(elem: HTMLElement) => void\' is not assignable to parameter of type \'(value: Element, index: number, array: Element[]) => void\'.\\n Types of parameters \'elem\' and \'value\' are incompatible.\\n Type \'Element\' is not assignable to type \'HTMLElement\'.", "644375802"],
[771, 51, 14, "Element implicitly has an \'any\' type because index expression is not of type \'number\'.", "1499311821"],
[784, 12, 12, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ _id: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ _id: string; }\'.", "83151076"],
[1550, 40, 45, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ prepared: string; spontaneous: string; innate: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ prepared: string; spontaneous: string; innate: string; }\'.", "1585367218"],
[1552, 73, 43, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ arcane: string; divine: string; occult: string; primal: string; focus: string; ritual: string; halcyon: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ arcane: string; divine: string; occult: string; primal: string; focus: string; ritual: string; halcyon: string; }\'.", "2969658523"]
[762, 51, 14, "Element implicitly has an \'any\' type because index expression is not of type \'number\'.", "1499311821"],
[775, 12, 12, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ _id: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ _id: string; }\'.", "83151076"],
[1541, 40, 45, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ prepared: string; spontaneous: string; innate: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ prepared: string; spontaneous: string; innate: string; }\'.", "1585367218"],
[1543, 73, 43, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ arcane: string; divine: string; occult: string; primal: string; focus: string; ritual: string; halcyon: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ arcane: string; divine: string; occult: string; primal: string; focus: string; ritual: string; halcyon: string; }\'.", "2969658523"]
],
"src/module/actor/sheet/character.ts:897768402": [
[69, 12, 70, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ 0: string; 1: string; 2: string; 3: string; }\'.", "2863222600"],
Expand Down Expand Up @@ -64,18 +62,18 @@ exports[`stricter compilation`] = {
[132, 37, 55, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ common: string; uncommon: string; rare: string; unique: string; agile: string; attached: string; backstabber: string; backswing: string; bomb: string; \'deadly-d6\': string; \'deadly-d8\': string; \'deadly-d10\': string; ... 181 more ...; hex: string; }\'.", "234184526"],
[137, 16, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ action: { label: string; actions: never[]; }; reaction: { label: string; actions: never[]; }; free: { label: string; actions: never[]; }; passive: { label: string; actions: never[]; }; }\'.", "3512893704"]
],
"src/module/actor/sheet/npc.ts:316983324": [
[53, 35, 32, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ acr: string; arc: string; ath: string; cra: string; dec: string; dip: string; itm: string; med: string; nat: string; occ: string; prf: string; rel: string; soc: string; ste: string; sur: string; thi: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ acr: string; arc: string; ath: string; cra: string; dec: string; dip: string; itm: string; med: string; nat: string; occ: string; prf: string; rel: string; soc: string; ste: string; sur: string; thi: string; }\'.", "3722560702"],
[154, 32, 48, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.", "2427086842"],
[156, 41, 54, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ common: string; uncommon: string; rare: string; unique: string; agile: string; attached: string; backstabber: string; backswing: string; bomb: string; \'deadly-d6\': string; \'deadly-d8\': string; \'deadly-d10\': string; ... 181 more ...; hex: string; }\'.", "219679053"],
[163, 16, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ melee: { label: string; prefix: string; items: never[]; type: string; }; ranged: { label: string; prefix: string; items: never[]; type: string; }; }\'.", "980161698"],
[177, 32, 48, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.", "2427086842"],
[179, 41, 54, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ common: string; uncommon: string; rare: string; unique: string; agile: string; attached: string; backstabber: string; backswing: string; bomb: string; \'deadly-d6\': string; \'deadly-d8\': string; \'deadly-d10\': string; ... 181 more ...; hex: string; }\'.", "219679053"],
[187, 28, 49, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.", "2677847065"],
[189, 37, 55, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ common: string; uncommon: string; rare: string; unique: string; agile: string; attached: string; backstabber: string; backswing: string; bomb: string; \'deadly-d6\': string; \'deadly-d8\': string; \'deadly-d10\': string; ... 181 more ...; hex: string; }\'.", "234184526"],
[194, 16, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ action: { label: string; actions: never[]; }; reaction: { label: string; actions: never[]; }; free: { label: string; actions: never[]; }; passive: { label: string; actions: never[]; }; }\'.", "3512893704"],
[207, 20, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ action: { label: string; actions: never[]; }; reaction: { label: string; actions: never[]; }; free: { label: string; actions: never[]; }; passive: { label: string; actions: never[]; }; }\'.", "3512893704"],
[371, 51, 14, "Element implicitly has an \'any\' type because index expression is not of type \'number\'.", "1499311821"]
"src/module/actor/sheet/npc.ts:1940159761": [
[45, 35, 32, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ acr: string; arc: string; ath: string; cra: string; dec: string; dip: string; itm: string; med: string; nat: string; occ: string; prf: string; rel: string; soc: string; ste: string; sur: string; thi: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ acr: string; arc: string; ath: string; cra: string; dec: string; dip: string; itm: string; med: string; nat: string; occ: string; prf: string; rel: string; soc: string; ste: string; sur: string; thi: string; }\'.", "3722560702"],
[141, 32, 48, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.", "2427086842"],
[143, 41, 54, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ common: string; uncommon: string; rare: string; unique: string; agile: string; attached: string; backstabber: string; backswing: string; bomb: string; \'deadly-d6\': string; \'deadly-d8\': string; \'deadly-d10\': string; ... 181 more ...; hex: string; }\'.", "219679053"],
[150, 16, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ melee: { label: string; prefix: string; items: never[]; type: string; }; ranged: { label: string; prefix: string; items: never[]; type: string; }; }\'.", "980161698"],
[164, 32, 48, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.", "2427086842"],
[166, 41, 54, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ common: string; uncommon: string; rare: string; unique: string; agile: string; attached: string; backstabber: string; backswing: string; bomb: string; \'deadly-d6\': string; \'deadly-d8\': string; \'deadly-d10\': string; ... 181 more ...; hex: string; }\'.", "219679053"],
[174, 28, 49, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ acid: string; adamantine: string; air: string; alchemical: string; agile: string; artifact: string; attached: string; backstabber: string; backswing: string; bomb: string; brutal: string; chaotic: string; ... 197 more ...; plant: string; }\'.", "2677847065"],
[176, 37, 55, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ common: string; uncommon: string; rare: string; unique: string; agile: string; attached: string; backstabber: string; backswing: string; bomb: string; \'deadly-d6\': string; \'deadly-d8\': string; \'deadly-d10\': string; ... 181 more ...; hex: string; }\'.", "234184526"],
[181, 16, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ action: { label: string; actions: never[]; }; reaction: { label: string; actions: never[]; }; free: { label: string; actions: never[]; }; passive: { label: string; actions: never[]; }; }\'.", "3512893704"],
[194, 20, 19, "Element implicitly has an \'any\' type because expression of type \'any\' can\'t be used to index type \'{ action: { label: string; actions: never[]; }; reaction: { label: string; actions: never[]; }; free: { label: string; actions: never[]; }; passive: { label: string; actions: never[]; }; }\'.", "3512893704"],
[358, 51, 14, "Element implicitly has an \'any\' type because index expression is not of type \'number\'.", "1499311821"]
],
"src/module/actor/sheet/popups/recall-knowledge-popup.ts:408671254": [
[23, 30, 25, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ acr: string; arc: string; ath: string; cra: string; dec: string; dip: string; itm: string; med: string; nat: string; occ: string; prf: string; rel: string; soc: string; ste: string; sur: string; thi: string; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ acr: string; arc: string; ath: string; cra: string; dec: string; dip: string; itm: string; med: string; nat: string; occ: string; prf: string; rel: string; soc: string; ste: string; sur: string; thi: string; }\'.", "1782166651"]
Expand Down Expand Up @@ -123,7 +121,7 @@ exports[`stricter compilation`] = {
[23, 31, 56, "Element implicitly has an \'any\' type because index expression is not of type \'number\'.", "1741159767"],
[25, 31, 56, "Element implicitly has an \'any\' type because index expression is not of type \'number\'.", "645286097"]
],
"src/module/item/base.ts:2316554235": [
"src/module/item/base.ts:2285530911": [
[58, 15, 10, "\'defaultImg\' implicitly has return type \'any\' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.", "2149796461"],
[59, 14, 8, "\'typeName\' implicitly has type \'any\' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.", "2203126554"],
[660, 59, 31, "Element implicitly has an \'any\' type because expression of type \'string\' can\'t be used to index type \'{ label: string; map2: number; map3: number; }\'.\\n No index signature with a parameter of type \'string\' was found on type \'{ label: string; map2: number; map3: number; }\'.", "3633182683"],
Expand Down Expand Up @@ -180,7 +178,7 @@ exports[`stricter compilation`] = {
[604, 25, 2, "Parameter \'nm\' implicitly has an \'any\' type.", "5861190"],
[605, 26, 2, "Parameter \'nm\' implicitly has an \'any\' type.", "5861190"]
],
"src/module/system/npc-skills-editor.ts:702930401": [
"src/module/system/npc-skills-editor.ts:1987742709": [
[11, 4, 8, "Property \'newItems\' has no initializer and is not definitely assigned in the constructor.", "286441727"]
],
"src/module/system/world-clock/index.ts:2000515647": [
Expand Down
9 changes: 0 additions & 9 deletions src/module/actor/sheet/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,15 +725,6 @@ export abstract class ActorSheetPF2e<ActorType extends ActorPF2e> extends ActorS
});
});

// change background for dragged over items that are containers
const containerItems = Array.from(html[0].querySelectorAll('[data-item-is-container="true"]'));
containerItems.forEach((elem: HTMLElement) =>
elem.addEventListener('dragenter', () => elem.classList.add('hover-container'), false),
);
containerItems.forEach((elem: HTMLElement) =>
elem.addEventListener('dragleave', () => elem.classList.remove('hover-container'), false),
);

// Item Rolling
html.find('[data-item-id].item .item-image').on('click', (event) => this.onItemRoll(event));

Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

"noImplicitThis": true,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"strictNullChecks": true,

"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,

Expand Down

0 comments on commit 69b7e71

Please sign in to comment.