{"id":19388110,"url":"https://github.com/zakimohammed/ng-eslint-prettier","last_synced_at":"2026-05-05T13:33:50.791Z","repository":{"id":221889553,"uuid":"755622695","full_name":"ZakiMohammed/ng-eslint-prettier","owner":"ZakiMohammed","description":"Angular project for setting up ESLint + Prettier","archived":false,"fork":false,"pushed_at":"2024-03-20T17:50:32.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T19:06:46.139Z","etag":null,"topics":["angular","angular-eslint","eslint","eslint-prettier","prettier"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ZakiMohammed.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":"2024-02-10T18:59:40.000Z","updated_at":"2024-02-10T19:01:52.000Z","dependencies_parsed_at":"2024-11-10T10:11:53.282Z","dependency_job_id":null,"html_url":"https://github.com/ZakiMohammed/ng-eslint-prettier","commit_stats":null,"previous_names":["zakimohammed/ng-eslint-prettier"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ZakiMohammed/ng-eslint-prettier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakiMohammed%2Fng-eslint-prettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakiMohammed%2Fng-eslint-prettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakiMohammed%2Fng-eslint-prettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakiMohammed%2Fng-eslint-prettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZakiMohammed","download_url":"https://codeload.github.com/ZakiMohammed/ng-eslint-prettier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZakiMohammed%2Fng-eslint-prettier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32651425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["angular","angular-eslint","eslint","eslint-prettier","prettier"],"created_at":"2024-11-10T10:11:48.519Z","updated_at":"2026-05-05T13:33:50.777Z","avatar_url":"https://github.com/ZakiMohammed.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ng ESLint Prettier\n\nAngular project for setting up ESLint + Prettier.\n\n## Run App\n\nBelow command will run the project:\n\n```\nnpm start\n```\n\n## Install Prettier\n\nAdd Prettier to the project as dev dependency:\n\n```\nnpm install --save-dev --save-exact prettier\n```\n\n## Configuration File\n\nCreate a Prettier configuration file `.prettierrc` to control the Prettier configurations at project level.\n\n``` json\n{\n  \"singleQuote\": true,\n  \"bracketSameLine\": true,\n  \"endOfLine\": \"auto\",\n  \"overrides\": [\n    {\n      \"files\": [\"*.html\", \"*.ts\"],\n      \"options\": {\n        \"printWidth\": 120\n      }\n    },\n    {\n      \"files\": \"*.html\",\n      \"options\": {\n        \"parser\": \"html\"\n      }\n    },\n    {\n      \"files\": \"*.component.html\",\n      \"options\": {\n        \"parser\": \"angular\"\n      }\n    }\n  ]\n}\n```\n\nHere, we are updating some of the few settings:\n\n- `singleQuotes`: Setting the to `true` to follow JS recommendation of using single quotes for string.\n- `bracketSameLine`: Setting the to `true` to make end of closing brackets appearing on the same line.\n- `endOfLine`: Setting the to `auto` to make the end of line to work as per environment.\n- `overrides`: Overriding settings for `.html` and `.ts` file `printWidth` size to `120` as SonarLint allows 120.\n\nRead more from here [Options Prettier](https://prettier.io/docs/en/options).\n\n## Ignore File\n\nCreate a Prettier ignore file `.prettierignore` to control which file to avoid for formatting.\n\n```\npackage.json\npackage-lock.json\ndist\n/.angular/cache\nlint-*\n```\n\nAdd a prettier command to run for entire project to format all of the files at once, this command can be handy to use in order to format the entire project.\n\n``` json\n{\n  \"scripts\": {\n    \"prettier:write\": \"prettier --config .prettierrc --write .\",\n    \"prettier:check\": \"prettier --config .prettierrc --check .\"\n  }\n}\n```\n___\n\n# Prettier Rule for ESLint\n\nUnderstand the philosophy of formatting with ESLint + Prettier from: [Formatting Philosophy](https://github.com/angular-eslint/angular-eslint/blob/main/docs/FORMATTING_RULES.md).\n\nThese 2 packages are required for adding Prettier rule to ESLint:\n\n1. **ESLint Config Prettier**: https://github.com/prettier/eslint-config-prettier (personally recommended as it keeps linting and formatting as separate responsibilities)\n1. **ESLint Plugin Prettier**: https://github.com/prettier/eslint-plugin-prettier (runs prettier within ESLint so you get feedback on violations from prettier itself rather\n\nAdd `eslint-config-prettier` to project:\n\n```\nnpm install --save-dev eslint-config-prettier\n```\n\nAdd `eslint-plugin-prettier` and `prettier` to project:\n\n```\nnpm install --save-dev eslint-plugin-prettier\nnpm install --save-dev --save-exact prettier\n```\n\nAdd Prettier rules to `.eslintrc.json`:\n\n``` json\n{\n  \"plugins\": [\n    \"prettier\"\n  ],\n  \"overrides\": [\n    {\n      \"files\": [\n        \"*.ts\"\n      ],\n      \"extends\": [\n        ...\n        \"plugin:prettier/recommended\"\n      ],\n    },\n    {\n      \"files\": [\n        \"*.html\"\n      ],\n      \"extends\": [\n        ...\n        \"plugin:prettier/recommended\"\n      ],\n    }\n  ]\n}\n```\n\nHere, we are adding the prettier rule to the `extends` array for `.ts` and `.html` files.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakimohammed%2Fng-eslint-prettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzakimohammed%2Fng-eslint-prettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakimohammed%2Fng-eslint-prettier/lists"}