Skip to content

Commit 5a0be95

Browse files
committed
fix: lint
1 parent f13d944 commit 5a0be95

8 files changed

Lines changed: 21 additions & 20 deletions

File tree

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
// Use Prettier to format "cspell.config.jsonc".
5151
"cSpell.autoFormatConfigFile": true,
5252

53+
// Change all ESLint errors to have yellow squigglies instead of red squigglies.
54+
// https://www.joshuakgoldberg.com/blog/if-i-wrote-a-linter-part-2-developer-experience/#only-errors
55+
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
56+
5357
// -----------------
5458
// Language settings
5559
// -----------------

packages/isaac-typescript-definitions-repentogon/src/types/classes/PocketItem.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ declare global {
3535
* }
3636
* ```
3737
*/
38-
GetSlot: () => CardType | PillColor | ActiveSlot | 0;
38+
GetSlot: () => CardType | PillColor | ActiveSlot;
3939

4040
/**
4141
* Returns the pocket item's `PocketItemType`.

packages/isaac-typescript-definitions-repentogon/src/types/classes/entity/EntityPlayer.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ declare global {
975975
* consumable, its sub type is returned. If the player used the Question Mark card, 1 is
976976
* returned. Otherwise, 0 is returned.
977977
*/
978-
GetWildCardItem: () => CollectibleType | CardType | PillEffect | 0;
978+
GetWildCardItem: () => CollectibleType | CardType | PillEffect;
979979

980980
/**
981981
* Returns the type of item that was last used by the player and would be used again upon using

packages/isaac-typescript-definitions/src/types/mods/EID.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ declare interface EIDInterface {
333333
Type: int,
334334
Variant: int,
335335
SubType: int,
336-
) => ["", "", string] | ["", string, string] | undefined;
336+
) => ["", string, string] | undefined;
337337

338338
/** Get `KColor` object of "Entity Name" texts. */
339339
getNameColor: () => KColor;

packages/isaacscript-common/src/classes/ModFeature.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ type ModFeatureConstructor = TSTLClassMetatable["constructor"] & {
6363
* upon first construction.)
6464
*/
6565
export class ModFeature {
66+
// Other features will extend from this feature and they might need access to the underlying mod.
67+
// eslint-disable-next-line @typescript-eslint/no-unused-private-class-members
6668
private readonly mod: ModUpgraded;
6769

6870
/**

packages/isaacscript-common/src/classes/ModUpgraded.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ export class ModUpgraded implements Mod {
410410
* called from the "upgradeMod" function, but we want to mark it as private so that end-users
411411
* don't have access to it.
412412
*/
413+
// eslint-disable-next-line @typescript-eslint/no-unused-private-class-members
413414
private initOptionalFeature(feature: ISCFeature): readonly FunctionTuple[] {
414415
const featureClass = this.features[feature];
415416
this.initFeature(featureClass);

packages/isaacscript-common/src/classes/features/other/saveDataManager/restoreDefaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function restoreDefaultForFeatureKey(
8080
const childTableDefaults = saveDataDefaults[saveDataKey];
8181
if (childTableDefaults === undefined) {
8282
logError(
83-
`Failed to find the default copy of the child table "${saveDataKey}" for subscriber "${subscriberName}". This error usually means that your mod-specific save data is out of date. You can try purging all of your mod-specific save data by deleting the following directory: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Binding of Isaac Rebirth\\data`,
83+
String.raw`Failed to find the default copy of the child table "${saveDataKey}" for subscriber "${subscriberName}". This error usually means that your mod-specific save data is out of date. You can try purging all of your mod-specific save data by deleting the following directory: C:\Program Files (x86)\Steam\steamapps\common\The Binding of Isaac Rebirth\data`,
8484
);
8585
return;
8686
}

packages/isaacscript-common/src/functions/deepCopyTests.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,7 @@ function copiedObjectHasChildObject() {
262262
function copiedMapIsMap() {
263263
const keyToLookFor = "abc";
264264
const valueToLookFor = "def";
265-
const oldMap = new Map<string, string>();
266-
oldMap.set(keyToLookFor, valueToLookFor);
265+
const oldMap = new Map<string, string>([[keyToLookFor, valueToLookFor]]);
267266

268267
const newMap = deepCopy(oldMap, SerializationType.NONE, "copiedMapIsMap");
269268

@@ -275,8 +274,7 @@ function copiedMapIsMap() {
275274
function copiedMapHasValue() {
276275
const keyToLookFor = "abc";
277276
const valueToLookFor = "def";
278-
const oldMap = new Map<string, string>();
279-
oldMap.set(keyToLookFor, valueToLookFor);
277+
const oldMap = new Map<string, string>([[keyToLookFor, valueToLookFor]]);
280278

281279
const newMap = deepCopy(oldMap, SerializationType.NONE, "copiedMapHasValue");
282280

@@ -295,8 +293,7 @@ function copiedMapHasValue() {
295293

296294
function copiedSetIsSet() {
297295
const valueToLookFor = "abc";
298-
const oldSet = new Set<string>();
299-
oldSet.add(valueToLookFor);
296+
const oldSet = new Set<string>([valueToLookFor]);
300297

301298
const newSet = deepCopy(oldSet, SerializationType.NONE, "copiedSetIsSet");
302299

@@ -307,8 +304,7 @@ function copiedSetIsSet() {
307304

308305
function copiedSetHasValue() {
309306
const valueToLookFor = "abc";
310-
const oldSet = new Set<string>();
311-
oldSet.add(valueToLookFor);
307+
const oldSet = new Set<string>([valueToLookFor]);
312308

313309
const newSet = deepCopy(oldSet, SerializationType.NONE, "copiedSetHasValue");
314310

@@ -325,12 +321,12 @@ function copiedSetHasValue() {
325321
function copiedMapHasChildMap() {
326322
const childMapKey = 123;
327323
const childMapValue = 456;
328-
const oldChildMap = new Map<number, number>();
329-
oldChildMap.set(childMapKey, childMapValue);
324+
const oldChildMap = new Map<number, number>([[childMapKey, childMapValue]]);
330325

331326
const keyToLookFor = "childMap";
332-
const oldMap = new Map<string, Map<number, number>>();
333-
oldMap.set(keyToLookFor, oldChildMap);
327+
const oldMap = new Map<string, Map<number, number>>([
328+
[keyToLookFor, oldChildMap],
329+
]);
334330

335331
const newMap = deepCopy(
336332
oldMap,
@@ -446,8 +442,7 @@ function copiedDefaultMapHasBrand() {
446442
function copiedSerializedMapHasStringKey() {
447443
const mapKey = "123";
448444
const mapValue = 456;
449-
const oldMap = new Map<string, number>();
450-
oldMap.set(mapKey, mapValue);
445+
const oldMap = new Map<string, number>([[mapKey, mapValue]]);
451446

452447
const serializedOldMap = deepCopy(
453448
oldMap,
@@ -473,8 +468,7 @@ function copiedSerializedMapHasStringKey() {
473468
function copiedSerializedMapHasNumberKey() {
474469
const mapKey = 123;
475470
const mapValue = 456;
476-
const oldMap = new Map<number, number>();
477-
oldMap.set(mapKey, mapValue);
471+
const oldMap = new Map<number, number>([[mapKey, mapValue]]);
478472

479473
const serializedOldMap = deepCopy(
480474
oldMap,

0 commit comments

Comments
 (0)