diff --git a/examples/nextjs-app/.eslintrc.json b/examples/nextjs-app/.eslintrc.json index 13db79fd..9f1fbaa4 100644 --- a/examples/nextjs-app/.eslintrc.json +++ b/examples/nextjs-app/.eslintrc.json @@ -3,7 +3,7 @@ "browser": true, "es2021": true }, - "extends": ["plugin:react/recommended", "airbnb-typescript/base", "plugin:prettier/recommended", "prettier"], + "extends": ["prettier", "airbnb-typescript/base", "plugin:prettier/recommended", "prettier"], "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaFeatures": { @@ -13,7 +13,7 @@ "sourceType": "module", "project": ["./tsconfig.json"] }, - "plugins": ["prettier", "react", "@typescript-eslint"], + "plugins": ["prettier", "react", "@typescript-eslint", "import"], "settings": { "import/resolver": { "node": { @@ -33,11 +33,13 @@ "tsx": "never" } ], + "prettier/prettier": "error", "react/jsx-filename-extension": [2, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }], "react/button-has-type": 0, "no-console": 0, "import/prefer-default-export": 0, "react/prop-types": 0, + "import/no-extraneous-dependencies": "error", "no-use-before-define": 0, "promise/always-return": 0, "react/forbid-prop-types": 0, diff --git a/examples/nextjs-app/.gitignore b/examples/nextjs-app/.gitignore index 1437c53f..1227ed22 100644 --- a/examples/nextjs-app/.gitignore +++ b/examples/nextjs-app/.gitignore @@ -1,7 +1,4 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules +# .gitignore /.pnp .pnp.js @@ -9,7 +6,7 @@ /coverage # next.js -/.next/ +/.next/ # Remove this line if present /out/ # production @@ -28,7 +25,4 @@ yarn-error.log* .env.local .env.development.local .env.test.local -.env.production.local - -# vercel -.vercel +.env.production.local \ No newline at end of file diff --git a/examples/nextjs-app/lib/constants.ts b/examples/nextjs-app/lib/constants.ts index d68c68f8..c153834c 100644 --- a/examples/nextjs-app/lib/constants.ts +++ b/examples/nextjs-app/lib/constants.ts @@ -54,7 +54,7 @@ export const verifierMap = { [TELEGRAM]: { name: "Telegram", typeOfLogin: "telegram", - clientId: "7974448012:AAGLN8ee4WnJhJt6Jc7_Sb275smMs-8K00I", + clientId: "7974448012", verifier: "test-telegram-2", }, [EMAIL_PASSWORD]: { diff --git a/examples/nextjs-app/package.json b/examples/nextjs-app/package.json index 6a816c6e..781ee54c 100644 --- a/examples/nextjs-app/package.json +++ b/examples/nextjs-app/package.json @@ -6,7 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "prepare": "husky" + "prepare": "husky", + "lint": "eslint --fix ." }, "dependencies": { "@toruslabs/customauth": "file:../..", @@ -21,6 +22,11 @@ "@types/react": "^18", "@types/react-dom": "^18", "eslint": "^9.18.0", + "eslint-config-airbnb-typescript": "^18.0.0", + "eslint-config-prettier": "^10.0.1", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-prettier": "^5.2.3", + "eslint-plugin-react": "^7.37.4", "husky": "^9.1.6", "lint-staged": "^15.2.10", "prettier": "^3.3.3", diff --git a/examples/nextjs-app/vercel.json b/examples/nextjs-app/vercel.json new file mode 100644 index 00000000..b959c394 --- /dev/null +++ b/examples/nextjs-app/vercel.json @@ -0,0 +1,15 @@ +{ + "version": 2, + "builds": [ + { + "src": "next.config.js", + "use": "@vercel/next" + } + ], + "routes": [ + { + "src": "/serviceworker", + "dest": "/serviceworker/redirect.html" + } + ] +} \ No newline at end of file