Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/github-pr.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/vercel-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Deploy 🐍 Snake to Vercel

on:
push:
branches: [develop]

jobs:
deploy:
runs-on: ubuntu-latest
environment: production

steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ A minimalist Snake clone built with React, TypeScript, and HTML Canvas — focus

![Gameplay preview](./src/app/assets/snake-gameplay.gif)

> Try it yourself — `npm run dev` then open [http://localhost:5173](http://localhost:5173)
---

🌐 Live Demo

Try Snake here: https://snake-beryl-six.vercel.app/

---

## 🎯 Features

Expand Down
82 changes: 0 additions & 82 deletions eslint.config.js

This file was deleted.

82 changes: 82 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// eslint.config.js
import js from '@eslint/js';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import globals from 'globals';
import tseslint from 'typescript-eslint';

export default [
// 🧹 Ignore build + coverage folders
{ ignores: ['dist', 'coverage'] },

// ✅ Base + TypeScript + React presets
js.configs.recommended,
...tseslint.configs.recommended,
reactHooks.configs['recommended-latest'],
reactRefresh.configs.vite,

// 🧩 App code (browser)
{
files: ['src/**/*.{ts,tsx,js,jsx}'],
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: { ecmaFeatures: { jsx: true } },
globals: globals.browser,
},
plugins: { react },
rules: {
// 🧠 React 17+ no longer requires importing React in JSX
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',

// 🧹 Lint polish
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-unused-expressions': [
'error',
{ allowShortCircuit: true, allowTernary: true },
],
'react-hooks/exhaustive-deps': 'warn',
},
settings: {
react: { version: 'detect' },
},
},

// 🧪 Tests (Vitest)
{
files: ['tests/**/*.{ts,tsx,js,jsx}', '**/*.test.{ts,tsx,js,jsx}'],
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: { ecmaFeatures: { jsx: true } },
globals: { ...globals.browser, ...globals.vitest },
},
plugins: { react },
rules: {
'react/react-in-jsx-scope': 'off',
},
},

// ⚙️ Config + scripts (Node env)
{
files: [
'*.config.{js,cjs,mjs,ts}',
'vite.config.*',
'vitest.config.*',
'scripts/**',
],
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
globals: globals.node,
},
},
];
4 changes: 3 additions & 1 deletion src/app/components/SnakeCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export default function SnakeCanvas() {
try {
a.currentTime = 0;
void a.play();
} catch {}
} catch {
console.error('Audio play exception:', err);
}
}, []);

// random free cell based on current tuning
Expand Down