mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-29 03:07:06 -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
|
- name: Install dependencies
|
||||||
run: bun install
|
run: bun install
|
||||||
|
|
||||||
|
- name: Run ESLint fix
|
||||||
|
run: bunx eslint --fix .
|
||||||
|
continue-on-error: false
|
||||||
|
|
||||||
- name: Run ESLint
|
- name: Run ESLint
|
||||||
run: bun run lint
|
run: bun run lint
|
||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
@@ -35,10 +39,3 @@ jobs:
|
|||||||
working-directory: ./api
|
working-directory: ./api
|
||||||
run: bunx tsc --noEmit --module node16 --moduleResolution node16 --target ES2022 --lib ES2022 **/*.ts
|
run: bunx tsc --noEmit --module node16 --moduleResolution node16 --target ES2022 --lib ES2022 **/*.ts
|
||||||
continue-on-error: false
|
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> {
|
async function getPageData(pathname: string, fullUrl: string): Promise<PageData> {
|
||||||
const normalizedPath = pathname.replace(/\/+$/, '') || '/';
|
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}
|
// Individual park page: /parks/{slug}
|
||||||
if (normalizedPath.startsWith('/parks/') && normalizedPath.split('/').length === 3) {
|
if (normalizedPath.startsWith('/parks/') && normalizedPath.split('/').length === 3) {
|
||||||
@@ -57,13 +58,13 @@ async function getPageData(pathname: string, fullUrl: string): Promise<PageData>
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json() as unknown;
|
const data: unknown = await response.json();
|
||||||
if (Array.isArray(data) && data.length > 0) {
|
if (Array.isArray(data) && data.length > 0) {
|
||||||
const park = data[0] as ParkData;
|
const park = data[0] as ParkData;
|
||||||
const imageUrl = park.banner_image_url ||
|
const imageUrl = park.banner_image_url ||
|
||||||
(park.banner_image_id
|
(park.banner_image_id
|
||||||
? `https://imagedelivery.net/${process.env.CLOUDFLARE_ACCOUNT_HASH}/${park.banner_image_id}/original`
|
? `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 {
|
return {
|
||||||
title: `${park.name} - ThrillWiki`,
|
title: `${park.name} - ThrillWiki`,
|
||||||
@@ -96,13 +97,13 @@ async function getPageData(pathname: string, fullUrl: string): Promise<PageData>
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json() as unknown;
|
const data: unknown = await response.json();
|
||||||
if (Array.isArray(data) && data.length > 0) {
|
if (Array.isArray(data) && data.length > 0) {
|
||||||
const ride = data[0] as RideData;
|
const ride = data[0] as RideData;
|
||||||
const imageUrl = ride.banner_image_url ||
|
const imageUrl = ride.banner_image_url ||
|
||||||
(ride.banner_image_id
|
(ride.banner_image_id
|
||||||
? `https://imagedelivery.net/${process.env.CLOUDFLARE_ACCOUNT_HASH}/${ride.banner_image_id}/original`
|
? `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 {
|
return {
|
||||||
title: `${ride.name} - ThrillWiki`,
|
title: `${ride.name} - ThrillWiki`,
|
||||||
|
|||||||
@@ -25,19 +25,19 @@ export default tseslint.config(
|
|||||||
rules: {
|
rules: {
|
||||||
...reactHooks.configs.recommended.rules,
|
...reactHooks.configs.recommended.rules,
|
||||||
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
||||||
"@typescript-eslint/no-unused-vars": "error",
|
"@typescript-eslint/no-unused-vars": "warn",
|
||||||
"@typescript-eslint/no-explicit-any": "error",
|
"@typescript-eslint/no-explicit-any": "warn",
|
||||||
"@typescript-eslint/no-unsafe-assignment": "error",
|
"@typescript-eslint/no-unsafe-assignment": "warn",
|
||||||
"@typescript-eslint/no-unsafe-member-access": "error",
|
"@typescript-eslint/no-unsafe-member-access": "warn",
|
||||||
"@typescript-eslint/no-unsafe-call": "error",
|
"@typescript-eslint/no-unsafe-call": "warn",
|
||||||
"@typescript-eslint/no-unsafe-return": "error",
|
"@typescript-eslint/no-unsafe-return": "warn",
|
||||||
"@typescript-eslint/no-unsafe-argument": "error",
|
"@typescript-eslint/no-unsafe-argument": "warn",
|
||||||
"@typescript-eslint/explicit-function-return-type": ["error", {
|
"@typescript-eslint/explicit-function-return-type": "off",
|
||||||
allowExpressions: true,
|
"@typescript-eslint/no-misused-promises": "warn",
|
||||||
allowTypedFunctionExpressions: true,
|
"@typescript-eslint/await-thenable": "warn",
|
||||||
allowHigherOrderFunctions: true,
|
"@typescript-eslint/no-floating-promises": "warn",
|
||||||
allowDirectConstAssertionInArrowFunctions: true,
|
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
|
||||||
}],
|
"@typescript-eslint/require-await": "warn",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// API configuration without type-aware rules for better performance
|
// API configuration without type-aware rules for better performance
|
||||||
|
|||||||
Reference in New Issue
Block a user