{"id":18282839,"url":"https://github.com/danielkhakbaz/next-eslint-prettier-husky-initialization","last_synced_at":"2026-04-11T11:01:48.985Z","repository":{"id":124847608,"uuid":"445765412","full_name":"Danielkhakbaz/Next-ESLint-Prettier-Husky-Initialization","owner":"Danielkhakbaz","description":"an Initialization of any project using: ESLint, Prettier, Husky and git.","archived":false,"fork":false,"pushed_at":"2024-03-21T18:05:23.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T23:48:37.918Z","etag":null,"topics":["eslint","git","husky","next","prettier","typescript"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Danielkhakbaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-08T08:30:10.000Z","updated_at":"2024-08-10T09:15:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"26da1e9a-e599-4806-bc81-440fe6c3f7f8","html_url":"https://github.com/Danielkhakbaz/Next-ESLint-Prettier-Husky-Initialization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danielkhakbaz%2FNext-ESLint-Prettier-Husky-Initialization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danielkhakbaz%2FNext-ESLint-Prettier-Husky-Initialization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danielkhakbaz%2FNext-ESLint-Prettier-Husky-Initialization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danielkhakbaz%2FNext-ESLint-Prettier-Husky-Initialization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Danielkhakbaz","download_url":"https://codeload.github.com/Danielkhakbaz/Next-ESLint-Prettier-Husky-Initialization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247983469,"owners_count":21028298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","git","husky","next","prettier","typescript"],"created_at":"2024-11-05T13:06:23.408Z","updated_at":"2026-04-11T11:01:43.961Z","avatar_url":"https://github.com/Danielkhakbaz.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# In order to setup a _Next.js_ app with _Typescript_, _ESLint_, _Prettier_, _Husky_ and also setting a _Git_ Repository, We have to follow these steps below\n\n## Git\n\n- At first, We should delete every Git file using: `rd .git /s/q`\n- Then we must initialize our Git in our Project using: `git init`\n- Add every single changed files to your Repository: `git add .`\n- Commit your changes on your Repository with: `git commit -m \"\"`\n- Create a new Repository on the Github website\n- Set the existing Git Repository with your Project using: `git remote add origin GIT_REP_ADDRESS`\n- Push all the changes with: `git push -u origin master`\n- You can see the content of a proper .gitignore file in here \u003chttps://github.com/Danielkhakbaz/Danial-Portfolio-Hub/blob/main/.gitignore\u003e\n\n## ESLint\n\n- Add ESLint to your Project: `yarn add eslint`\n- Start initializing ESLint for your Project: `yarn run eslint --init`\n- This is the .eslintrc.json I used for my projects, I provide you the link so you can use it for your projects \u003chttps://github.com/Danielkhakbaz/Danial-Portfolio-Hub/blob/main/.eslintrc.json\u003e\n- You can see the content of a proper .eslintignore in here \u003chttps://github.com/Danielkhakbaz/Danial-Portfolio-Hub/blob/main/.eslintignore\u003e\n- Add the \"next\" and \"prettier\" in the end of all the extends in the .eslintrc.json file\n\n## Prettier\n\n- Add Prettier to your Project: `yarn add prettier`\n- Then add \"prettier\" to your .eslintrc file as one of the extends\n- Install this package for the solving the conflict between ESLint and Prettier using: `yarn add eslint-config-prettier \u0026\u0026 yarn add eslint-config-next`\n- Create a .prettierrc file and start writing your rules as a json\n- Suggested rules are:\n  `{\n  \"printWidth\": 80,\n  \"tabWidth\": 2,\n  \"semi\": true,\n  \"singleQuote\": false,\n  \"bracketSpacing\": true,\n  \"bracketSameLine\": false,\n  \"trailingComma\": \"es5\",\n  \"endOfLine\": \"lf\"\n}\n`\n- You can see the content of a proper .prettierignore in here \u003chttps://github.com/Danielkhakbaz/Danial-Portfolio-Hub/blob/main/.prettierignore\u003e\n\n## Next.js\n\n- My go-to next.config.js is in here \u003chttps://github.com/Danielkhakbaz/Danial-Portfolio-Hub/blob/main/next.config.js\u003e\n\n## Typescript\n\n- My go-to tsconfig.json is in here \u003chttps://github.com/Danielkhakbaz/Danial-Portfolio-Hub/blob/main/tsconfig.json\u003e\n\n## VSCode\n\n- Set your default formatter on VSCode to Prettier - Code Formatter\n- Then turn on the FormatOnSave and FormatOnPaste on your settings\n- Create a new Folder named .vscode\n- Inside that, Create a settings.json\n- Start writing these codes as json in the settings.json file:\n  `{\"editor.formatOnPaste\": true,\n  \"editor.formatOnSave\": true,\n  \"editor.defaultFormatter\": \"esbenp.prettier-vscode\",\n  \"editor.codeActionsOnSave\": {\n    \"source.fixAll.eslint\": \"explicit\",\n    \"source.fixAll.format\": \"explicit\"\n  }}`\n\n## Husky\n\n- Install husky on your Project: `npx husky-init \u0026\u0026 yarn`\n- Add these lines of scripts to your package.json file:\n  ` \"dev\": \"next dev\",\n    \"build\": \"next build\",\n    \"start\": \"next start\",\n    \"fix\": \"next lint --fix \u0026\u0026 prettier --write .\",\n    \"lint\": \"next lint\",\n    \"upgrade\": \"upgrade-interactive --latest\",\n    \"knip\": \"npx knip\",\n    \"analyze\": \"ANALYZE=true yarn build\",\n    \"postinstall\": \"husky install \u0026\u0026 prisma generate\"`\n- Add these texts from \u003chttps://github.com/Danielkhakbaz/Danial-Portfolio-Hub/blob/main/.husky/pre-commit\u003e to pre-commit file inside .husky folder\n- Just in case You're using yarn instead of npm, You should pay attention to the pre-commit file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielkhakbaz%2Fnext-eslint-prettier-husky-initialization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielkhakbaz%2Fnext-eslint-prettier-husky-initialization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielkhakbaz%2Fnext-eslint-prettier-husky-initialization/lists"}