Skip to content

Commit

Permalink
Update eslint dependencies and fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
prototypa committed Aug 26, 2024
1 parent a268583 commit 0202552
Show file tree
Hide file tree
Showing 11 changed files with 541 additions and 1,823 deletions.
2,319 changes: 518 additions & 1,801 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onwidget/astrowind",
"version": "1.0.0-beta.40",
"version": "1.0.0-beta.41",
"description": "AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.",
"type": "module",
"private": true,
Expand Down Expand Up @@ -40,13 +40,13 @@
"@types/eslint__js": "^8.42.3",
"@types/js-yaml": "^4.0.9",
"@types/lodash.merge": "^4.6.9",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@types/mdx": "^2.0.13",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"astro-compress": "2.3.1",
"astro-eslint-parser": "^1.0.2",
"eslint": "8.57.0",
"eslint": "^9.9.1",
"eslint-plugin-astro": "^1.2.3",
"eslint-plugin-jsx-a11y": "^6.9.0",
"globals": "^15.9.0",
"js-yaml": "^4.1.0",
"mdast-util-to-string": "^4.0.0",
Expand All @@ -58,6 +58,6 @@
"tailwind-merge": "^2.5.2",
"tailwindcss": "^3.4.10",
"typescript": "^5.5.4",
"typescript-eslint": "^7.16.1"
"typescript-eslint": "^8.2.0"
}
}
}
4 changes: 1 addition & 3 deletions src/components/widgets/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ interface Link {
icon?: string;
}
interface ActionLink extends CallToAction {}
interface MenuLink extends Link {
links?: Array<MenuLink>;
}
export interface Props {
id?: string;
links?: Array<MenuLink>;
actions?: Array<ActionLink>;
actions?: Array<CallToAction>;
isSticky?: boolean;
isDark?: boolean;
isFullWidth?: boolean;
Expand Down
1 change: 0 additions & 1 deletion src/components/widgets/Hero.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import Image from '~/components/common/Image.astro';
import Button from '~/components/ui/Button.astro';
import Background from '~/components/ui/Background.astro';
import type { Hero as Props } from '~/types';
Expand Down
1 change: 0 additions & 1 deletion src/components/widgets/Hero2.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import Image from '~/components/common/Image.astro';
import Button from '~/components/ui/Button.astro';
import Background from '~/components/ui/Background.astro';
import type { Hero as Props } from '~/types';
Expand Down
7 changes: 5 additions & 2 deletions src/utils/blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ export const getStaticPathsBlogCategory = async ({ paginate }: { paginate: Pagin
const posts = await fetchPosts();
const categories = {};
posts.map((post) => {
post.category?.slug && (categories[post.category?.slug] = post.category);
if (post.category?.slug) {
categories[post.category?.slug] = post.category;
}
});

return Array.from(Object.keys(categories)).flatMap((categorySlug) =>
Expand All @@ -222,10 +224,11 @@ export const getStaticPathsBlogTag = async ({ paginate }: { paginate: PaginateFu
const posts = await fetchPosts();
const tags = {};
posts.map((post) => {
Array.isArray(post.tags) &&
if (Array.isArray(post.tags)) {
post.tags.map((tag) => {
tags[tag?.slug] = tag;
});
}
});

return Array.from(Object.keys(tags)).flatMap((tagSlug) =>
Expand Down
4 changes: 1 addition & 3 deletions src/utils/images-optimization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import type { HTMLAttributes } from 'astro/types';

type Layout = 'fixed' | 'constrained' | 'fullWidth' | 'cover' | 'responsive' | 'contained';

export interface AttributesProps extends HTMLAttributes<'img'> {}

export interface ImageProps extends Omit<HTMLAttributes<'img'>, 'src'> {
src?: string | ImageMetadata | null;
width?: string | number | null;
Expand Down Expand Up @@ -263,7 +261,7 @@ export async function getImagesOptimized(
image: ImageMetadata | string,
{ src: _, width, height, sizes, aspectRatio, widths, layout = 'constrained', style = '', ...rest }: ImageProps,
transform: ImagesOptimizer = () => Promise.resolve([])
): Promise<{ src: string; attributes: AttributesProps }> {
): Promise<{ src: string; attributes: HTMLAttributes<'img'> }> {
if (typeof image !== 'string') {
width ||= Number(image.width) || undefined;
height ||= typeof width === 'number' ? computeHeight(width, image.width / image.height) : undefined;
Expand Down
3 changes: 2 additions & 1 deletion src/utils/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const load = async function () {
let images: Record<string, () => Promise<unknown>> | undefined = undefined;
try {
images = import.meta.glob('~/assets/images/**/*.{jpeg,jpg,png,tiff,webp,gif,svg,JPEG,JPG,PNG,TIFF,WEBP,GIF,SVG}');
} catch (e) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (error) {
// continue regardless of error
}
return images;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
"~/*": ["src/*"]
}
}
}
}
5 changes: 3 additions & 2 deletions vendor/integration/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,11 @@ export default ({ config: _themeConfig = 'src/config.yaml' } = {}) => {
});
}
}
} catch (err) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (error) {
/* empty */
}
},
},
};
};
};
4 changes: 3 additions & 1 deletion vendor/integration/utils/configBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export interface AnalyticsConfig {
};
}

export interface UIConfig {}
export interface UIConfig {
theme: string;
}

const DEFAULT_SITE_NAME = 'Website';

Expand Down

0 comments on commit 0202552

Please sign in to comment.