diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9efcca4..7dd1776 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ on: - workos permissions: - contents: write + contents: read jobs: quality: @@ -35,17 +35,11 @@ jobs: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist npm install - - name: Run Pint - run: composer lint + - name: Check PHP Code Style (Pint) + run: composer lint:check - - name: Format Frontend - run: npm run format + - name: Check Frontend Formatting (Prettier) + run: npm run format:check - - name: Lint Frontend - run: npm run lint - - # - name: Commit Changes - # uses: stefanzweifel/git-auto-commit-action@v7 - # with: - # commit_message: fix code style - # commit_options: '--no-verify' + - name: Lint Frontend (ESLint) + run: npm run lint:check diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..bd73ce0 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,2 @@ +npx lint-staged + diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000..0531377 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,12 @@ +{ + "**/*.php": [ + "vendor/bin/pint" + ], + "resources/**/*.{vue,ts,js}": [ + "prettier --write", + "eslint --fix" + ], + "resources/**/*.{css,json}": [ + "prettier --write" + ] +} diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 9b42ce1..21f4f8f 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -2,13 +2,11 @@ namespace App\Http\Controllers; -use App\Http\Controllers\Controller; use App\Mail\WelcomeUserMail; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Mail; -use Illuminate\Support\Str; use Inertia\Inertia; use Laravel\Socialite\Facades\Socialite; diff --git a/package-lock.json b/package-lock.json index efed936..4bc4fce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,8 @@ "eslint-import-resolver-typescript": "^4.4.4", "eslint-plugin-import": "^2.32.0", "eslint-plugin-vue": "^9.32.0", + "husky": "^9.1.7", + "lint-staged": "^17.4.1", "prettier": "^3.4.2", "prettier-plugin-tailwindcss": "^0.6.11", "typescript-eslint": "^8.23.0", @@ -6267,6 +6269,22 @@ "he": "bin/he" } }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/idb": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/idb/-/idb-7.1.1.tgz", @@ -7297,6 +7315,30 @@ "url": "https://opencollective.com/parcel" } }, + "node_modules/lint-staged": { + "version": "17.4.1", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-17.4.1.tgz", + "integrity": "sha512-FmJeudcalbSfg1du+JCfvi5vS6Qt08KgbfLWiHinbef+2JJwUZwAWVoaO1AcJVUTWPfk0t30PMQNwPAeCzYQ+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^4.0.7", + "string-argv": "^0.3.2", + "tinyexec": "^1.3.0" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "engines": { + "node": ">=22.22.1" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + }, + "optionalDependencies": { + "yaml": "^2.9.0" + } + }, "node_modules/loadjs": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loadjs/-/loadjs-4.3.0.tgz", @@ -7828,9 +7870,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", - "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", "license": "MIT", "engines": { "node": ">=12" @@ -8702,6 +8744,16 @@ "node": ">= 0.4" } }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -8982,6 +9034,16 @@ "node": ">=10" } }, + "node_modules/tinyexec": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz", + "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/tinyglobby": { "version": "0.2.17", "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", @@ -10013,6 +10075,22 @@ "dev": true, "license": "ISC" }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "license": "ISC", + "optional": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", diff --git a/package.json b/package.json index 19db3aa..0032c2f 100644 --- a/package.json +++ b/package.json @@ -1,55 +1,58 @@ { - "$schema": "https://www.schemastore.org/package.json", - "private": true, - "type": "module", - "scripts": { - "build": "vite build", - "build:ssr": "vite build && vite build --ssr", - "dev": "vite", - "format": "prettier --write resources/", - "format:check": "prettier --check resources/", - "lint": "eslint . --fix", - "lint:check": "eslint .", - "types:check": "vue-tsc --noEmit" - }, - "devDependencies": { - "@eslint/js": "^9.19.0", - "@laravel/vite-plugin-wayfinder": "^0.1.3", - "@stylistic/eslint-plugin": "^5.10.0", - "@types/node": "^22.13.5", - "@vue/eslint-config-typescript": "^14.3.0", - "eslint": "^9.17.0", - "eslint-config-prettier": "^10.1.8", - "eslint-import-resolver-typescript": "^4.4.4", - "eslint-plugin-import": "^2.32.0", - "eslint-plugin-vue": "^9.32.0", - "prettier": "^3.4.2", - "prettier-plugin-tailwindcss": "^0.6.11", - "typescript-eslint": "^8.23.0", - "vite-plugin-pwa": "^1.3.0", - "vue-tsc": "^2.2.4" - }, - "dependencies": { - "@inertiajs/vite": "^3.0.0", - "@inertiajs/vue3": "^3.0.0", - "@tailwindcss/vite": "^4.1.11", - "@vitejs/plugin-vue": "^6.0.0", - "clsx": "^2.1.1", - "concurrently": "^9.0.1", - "laravel-echo": "^2.4.0", - "laravel-vite-plugin": "^3.1", - "lucide-vue-next": "^1.0.0", - "plyr": "^3.8.4", - "pusher-js": "^8.6.0", - "tailwind-merge": "^3.2.0", - "tailwindcss": "^4.1.1", - "typescript": "^5.2.2", - "vite": "^8.0.0", - "vue": "^3.5.13" - }, - "optionalDependencies": { - "@rollup/rollup-linux-x64-gnu": "4.9.5", - "@tailwindcss/oxide-linux-x64-gnu": "^4.0.1", - "lightningcss-linux-x64-gnu": "^1.29.1" - } + "$schema": "https://www.schemastore.org/package.json", + "private": true, + "type": "module", + "scripts": { + "build": "vite build", + "build:ssr": "vite build && vite build --ssr", + "dev": "vite", + "format": "prettier --write resources/", + "format:check": "prettier --check resources/", + "lint": "eslint . --fix", + "lint:check": "eslint .", + "types:check": "vue-tsc --noEmit", + "prepare": "husky" + }, + "devDependencies": { + "@eslint/js": "^9.19.0", + "@laravel/vite-plugin-wayfinder": "^0.1.3", + "@stylistic/eslint-plugin": "^5.10.0", + "@types/node": "^22.13.5", + "@vue/eslint-config-typescript": "^14.3.0", + "eslint": "^9.17.0", + "eslint-config-prettier": "^10.1.8", + "eslint-import-resolver-typescript": "^4.4.4", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-vue": "^9.32.0", + "husky": "^9.1.7", + "lint-staged": "^17.4.1", + "prettier": "^3.4.2", + "prettier-plugin-tailwindcss": "^0.6.11", + "typescript-eslint": "^8.23.0", + "vite-plugin-pwa": "^1.3.0", + "vue-tsc": "^2.2.4" + }, + "dependencies": { + "@inertiajs/vite": "^3.0.0", + "@inertiajs/vue3": "^3.0.0", + "@tailwindcss/vite": "^4.1.11", + "@vitejs/plugin-vue": "^6.0.0", + "clsx": "^2.1.1", + "concurrently": "^9.0.1", + "laravel-echo": "^2.4.0", + "laravel-vite-plugin": "^3.1", + "lucide-vue-next": "^1.0.0", + "plyr": "^3.8.4", + "pusher-js": "^8.6.0", + "tailwind-merge": "^3.2.0", + "tailwindcss": "^4.1.1", + "typescript": "^5.2.2", + "vite": "^8.0.0", + "vue": "^3.5.13" + }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "4.9.5", + "@tailwindcss/oxide-linux-x64-gnu": "^4.0.1", + "lightningcss-linux-x64-gnu": "^1.29.1" + } }