chore(lint): remove unnecessary type assertions

The updated @typescript-eslint 8.59.3 flags type assertions that don't
change the expression type or whose receiver already accepts the
original type.
This commit is contained in:
Forketyfork 2026-05-18 11:40:47 +02:00
parent 1bf4ec0290
commit e4cd388e9d
No known key found for this signature in database
5 changed files with 7 additions and 7 deletions

View file

@ -276,7 +276,7 @@ export default class FoodTrackerPlugin extends Plugin {
...DEFAULT_SETTINGS,
// On mobile devices, default to "document" display mode for better visibility
totalDisplayMode: Platform.isMobile ? "document" : DEFAULT_SETTINGS.totalDisplayMode,
} as FoodTrackerPluginSettings;
};
const merged = Object.assign({}, mobileAwareDefaults, savedData);
merged.frontmatterFieldNames = {

View file

@ -48,7 +48,7 @@ function sanitizeFrontmatterFieldNames(
...fieldNames,
};
const sanitized: FrontmatterFieldNames = { ...merged } as FrontmatterFieldNames;
const sanitized: FrontmatterFieldNames = { ...merged };
const seen = new Set<string>();
for (const key of FRONTMATTER_KEYS_ORDER) {

View file

@ -33,7 +33,7 @@ describe("NutrientCache", () => {
const file = createFile("nutrients/apple.md");
const frontmatterMap: FrontmatterMap = {
[file.path]: { frontmatter: { name: "apple" } } as unknown as CachedMetadata,
[file.path]: { frontmatter: { name: "apple" } },
};
const app = createApp(frontmatterMap, [file]);
@ -51,7 +51,7 @@ describe("NutrientCache", () => {
expect(cache.hasPendingMetadataFor("apple")).toBe(true);
// Metadata becomes available after parsing finishes
frontmatterMap[file.path] = { frontmatter: { name: "apple", calories: 10 } } as unknown as CachedMetadata;
frontmatterMap[file.path] = { frontmatter: { name: "apple", calories: 10 } };
cache.updateCache(file, "modify");
expect(cache.getNutrientNames()).toEqual(["apple"]);
@ -69,7 +69,7 @@ describe("NutrientCache", () => {
nutrition_per: 28,
serving_size: 28,
},
} as unknown as CachedMetadata,
},
};
const app = createApp(frontmatterMap, [file]);
const cache = new NutrientCache(app, "nutrients");

View file

@ -21,7 +21,7 @@ global.createEl = jest.fn().mockImplementation((tag: string, options?: any) => {
}
if (options?.attr) {
Object.entries(options.attr).forEach(([key, value]) => {
element.setAttribute(key, value as string);
element.setAttribute(key, value);
});
}

View file

@ -66,7 +66,7 @@ function createApp(config: AppTestConfig): App {
if (frontmatter === null) {
return null;
}
return { frontmatter } as unknown as CachedMetadata;
return { frontmatter };
};
const fileManager = app.fileManager as unknown as {