mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-28 23:26:59 -05:00
Compare commits
6 Commits
b5bf0bcda1
...
2829f5f491
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2829f5f491 | ||
|
|
27699a2502 | ||
|
|
40d19d7e5f | ||
|
|
001416659e | ||
|
|
c681745086 | ||
|
|
f3c2a01e73 |
11
.github/workflows/lint.yml
vendored
11
.github/workflows/lint.yml
vendored
@@ -23,6 +23,10 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: Run ESLint fix
|
||||
run: bunx eslint --fix .
|
||||
continue-on-error: false
|
||||
|
||||
- name: Run ESLint
|
||||
run: bun run lint
|
||||
continue-on-error: false
|
||||
@@ -35,10 +39,3 @@ jobs:
|
||||
working-directory: ./api
|
||||
run: bunx tsc --noEmit --module node16 --moduleResolution node16 --target ES2022 --lib ES2022 **/*.ts
|
||||
continue-on-error: false
|
||||
|
||||
- name: Notify Vercel
|
||||
if: always()
|
||||
uses: vercel/repository-dispatch/actions/status@v1
|
||||
with:
|
||||
name: 'Vercel - thrillwiki: lint'
|
||||
status: ${{ job.status }}
|
||||
|
||||
@@ -40,6 +40,7 @@ interface RideData {
|
||||
|
||||
async function getPageData(pathname: string, fullUrl: string): Promise<PageData> {
|
||||
const normalizedPath = pathname.replace(/\/+$/, '') || '/';
|
||||
const DEFAULT_FALLBACK_IMAGE = 'https://imagedelivery.net/X-2-mmiWukWxvAQQ2_o-7Q/4af6a0c6-4450-497d-772f-08da62274100/original';
|
||||
|
||||
// Individual park page: /parks/{slug}
|
||||
if (normalizedPath.startsWith('/parks/') && normalizedPath.split('/').length === 3) {
|
||||
@@ -57,13 +58,13 @@ async function getPageData(pathname: string, fullUrl: string): Promise<PageData>
|
||||
);
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json() as unknown;
|
||||
const data: unknown = await response.json();
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
const park = data[0] as ParkData;
|
||||
const imageUrl = park.banner_image_url ||
|
||||
(park.banner_image_id
|
||||
? `https://imagedelivery.net/${process.env.CLOUDFLARE_ACCOUNT_HASH}/${park.banner_image_id}/original`
|
||||
: process.env.DEFAULT_OG_IMAGE);
|
||||
: (process.env.DEFAULT_OG_IMAGE || DEFAULT_FALLBACK_IMAGE));
|
||||
|
||||
return {
|
||||
title: `${park.name} - ThrillWiki`,
|
||||
@@ -96,13 +97,13 @@ async function getPageData(pathname: string, fullUrl: string): Promise<PageData>
|
||||
);
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json() as unknown;
|
||||
const data: unknown = await response.json();
|
||||
if (Array.isArray(data) && data.length > 0) {
|
||||
const ride = data[0] as RideData;
|
||||
const imageUrl = ride.banner_image_url ||
|
||||
(ride.banner_image_id
|
||||
? `https://imagedelivery.net/${process.env.CLOUDFLARE_ACCOUNT_HASH}/${ride.banner_image_id}/original`
|
||||
: process.env.DEFAULT_OG_IMAGE);
|
||||
: (process.env.DEFAULT_OG_IMAGE || DEFAULT_FALLBACK_IMAGE));
|
||||
|
||||
return {
|
||||
title: `${ride.name} - ThrillWiki`,
|
||||
|
||||
@@ -25,19 +25,19 @@ export default tseslint.config(
|
||||
rules: {
|
||||
...reactHooks.configs.recommended.rules,
|
||||
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
||||
"@typescript-eslint/no-unused-vars": "error",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/no-unsafe-assignment": "error",
|
||||
"@typescript-eslint/no-unsafe-member-access": "error",
|
||||
"@typescript-eslint/no-unsafe-call": "error",
|
||||
"@typescript-eslint/no-unsafe-return": "error",
|
||||
"@typescript-eslint/no-unsafe-argument": "error",
|
||||
"@typescript-eslint/explicit-function-return-type": ["error", {
|
||||
allowExpressions: true,
|
||||
allowTypedFunctionExpressions: true,
|
||||
allowHigherOrderFunctions: true,
|
||||
allowDirectConstAssertionInArrowFunctions: true,
|
||||
}],
|
||||
"@typescript-eslint/no-unused-vars": "warn",
|
||||
"@typescript-eslint/no-explicit-any": "warn",
|
||||
"@typescript-eslint/no-unsafe-assignment": "warn",
|
||||
"@typescript-eslint/no-unsafe-member-access": "warn",
|
||||
"@typescript-eslint/no-unsafe-call": "warn",
|
||||
"@typescript-eslint/no-unsafe-return": "warn",
|
||||
"@typescript-eslint/no-unsafe-argument": "warn",
|
||||
"@typescript-eslint/explicit-function-return-type": "off",
|
||||
"@typescript-eslint/no-misused-promises": "warn",
|
||||
"@typescript-eslint/await-thenable": "warn",
|
||||
"@typescript-eslint/no-floating-promises": "warn",
|
||||
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
|
||||
"@typescript-eslint/require-await": "warn",
|
||||
},
|
||||
},
|
||||
// API configuration without type-aware rules for better performance
|
||||
|
||||
Reference in New Issue
Block a user