Skip to content

Commit 744f99c

Browse files
committed
clean up
1 parent e2c1d84 commit 744f99c

File tree

184 files changed

+10801
-10449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+10801
-10449
lines changed

.eslintrc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ module.exports = {
8888
// revisit these
8989
"@typescript-eslint/no-unsafe-call": "off",
9090
"@typescript-eslint/no-unsafe-member-access": "off",
91-
"t@typescript-eslint/consistent-type-definitions": "off",
91+
"@typescript-eslint/consistent-type-definitions": "off",
92+
93+
// until it stops fighting with itself
94+
"@typescript-eslint/no-inferrable-types": "off",
9295
},
9396
globals: {
9497
__static: true,

.vscode/launch.json

+35-25
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
"version": "0.2.0",
6-
"configurations": [
7-
{
8-
"name": "Debug Jest Tests",
9-
"type": "node",
10-
"request": "launch",
11-
"runtimeArgs": [
12-
"--inspect-brk",
13-
"${workspaceRoot}/node_modules/jest/bin/jest",
14-
"--runInBand",
15-
"--no-cache"
16-
],
17-
"console": "integratedTerminal",
18-
"internalConsoleOptions": "neverOpen",
19-
"smartStep": true,
20-
"skipFiles": ["<node_internals>/**", "node_modules/**"],
21-
"autoAttachChildProcesses": true,
22-
"sourceMaps": true,
23-
"disableOptimisticBPs": "true",
24-
"outFiles": ["${workspaceFolder}/**/*.js", "!**/node_modules/**"]
25-
}
26-
]
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Debug Jest Tests",
9+
"type": "node",
10+
"request": "launch",
11+
"runtimeArgs": [
12+
"--inspect-brk",
13+
"${workspaceRoot}/node_modules/jest/bin/jest",
14+
"--runInBand",
15+
"--no-cache"
16+
],
17+
"console": "integratedTerminal",
18+
"internalConsoleOptions": "neverOpen",
19+
"smartStep": true,
20+
"skipFiles": ["<node_internals>/**", "node_modules/**"],
21+
"autoAttachChildProcesses": true,
22+
"sourceMaps": true,
23+
"disableOptimisticBPs": "true",
24+
"outFiles": ["${workspaceFolder}/**/*.js", "!**/node_modules/**"]
25+
},
26+
{
27+
"type": "node-terminal",
28+
"request": "launch",
29+
"name": "Run tsc verbosely",
30+
"command": "yarn tsc -b --verbose --noEmit",
31+
"presentation": {
32+
"reveal": "always",
33+
"panel": "new"
34+
}
35+
}
36+
]
2737
}

src/common/bwdat/dat.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ export interface FormatType {
66
size: number;
77
names?: string[];
88
name?: string;
9-
get?: ( i: number ) => any;
9+
get?: ( i: number ) => unknown;
1010
range?: () => number[];
1111
}
1212

13-
export class DAT<Type> {
13+
export class DAT<Type extends object> {
1414
private readonly readFile: ReadFile;
1515
private initialized?: Promise<string[]>;
1616
stats: string[] = [];
@@ -118,10 +118,10 @@ export class DAT<Type> {
118118

119119
return values.reduce<Type>( ( memo: Type, { name, value } ) => {
120120
return { ...memo, [name as keyof Type]: value } as Type;
121-
}, {} );
121+
}, {} as unknown as Type );
122122
} );
123123

124-
return ( this.entries = await this.post( entries ) );
124+
return ( this.entries = this.post( entries ) );
125125
}
126126

127127
protected post( entries: Type[] ) {

src/common/bwdat/parse-lo.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Vector2 } from "three";
21
import range from "../utils/range";
32

4-
export type LoDAT = Vector2[][];
3+
export type LoDAT = number[][][];
54

65
export const parseLo = ( buf: Buffer ): LoDAT => {
76
const frames = buf.readUInt32LE( 0 );
@@ -10,7 +9,7 @@ export const parseLo = ( buf: Buffer ): LoDAT => {
109
const frameData = range( 0, frames ).map( ( frame ) => {
1110
let offset = buf.readUInt32LE( 8 + 4 * frame );
1211
return range( 0, overlays ).map( () => {
13-
const coords = new Vector2( buf.readInt8( offset ), buf.readInt8( offset + 1 ) );
12+
const coords = [buf.readInt8( offset ), buf.readInt8( offset + 1 )];
1413
offset = offset + 2;
1514
return coords;
1615
} );

src/common/macros/field-utilities.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const isValidTypeOfField = ( type: string ): type is TypeOfField => {
9494

9595
export type TypeOfField = "boolean" | "number" | "string" | "vector";
9696

97-
export const getTypeOfField = ( field?: FieldDefinition ): TypeOfField | null => {
97+
export const getTypeOfField = ( field?: FieldDefinition | null ): TypeOfField | null => {
9898
if ( !field ) {
9999
return null;
100100
}

src/common/macros/sanitize-macros.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
TargetedPath,
99
} from "common/types";
1010
import { withErrorMessage } from "common/utils/with-error-message";
11-
import { FieldDefinition, Operator } from "../types/mutations";
11+
import { FieldDefinition, Operator } from "../types/fields";
1212
import {
1313
getAppFieldDefinition,
1414
SettingsAndPluginsMeta,
@@ -94,7 +94,7 @@ const optionExists = ( options: Required<FieldDefinition>["options"], value: str
9494
const patchValue = ( action: MacroAction | MacroCondition, field: FieldDefinition ) => {
9595
if (
9696
action.value === undefined ||
97-
( field.options && !optionExists( field.options, action.value ) )
97+
( field.options && !optionExists( field.options, action.value as string ) )
9898
) {
9999
action.value = field.value;
100100
}

src/common/types/declarations/package-json.d.ts

-1
This file was deleted.

0 commit comments

Comments
 (0)