{"id":49827278,"url":"https://github.com/Leritas/eslint-plugin-angular-class-ordering","last_synced_at":"2026-05-15T20:01:10.120Z","repository":{"id":356518040,"uuid":"1232821786","full_name":"Leritas/eslint-plugin-angular-class-ordering","owner":"Leritas","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-08T12:49:39.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T13:28:38.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Leritas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-08T10:00:33.000Z","updated_at":"2026-05-08T12:49:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Leritas/eslint-plugin-angular-class-ordering","commit_stats":null,"previous_names":["leritas/eslint-plugin-angular-class-ordering"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Leritas/eslint-plugin-angular-class-ordering","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leritas%2Feslint-plugin-angular-class-ordering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leritas%2Feslint-plugin-angular-class-ordering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leritas%2Feslint-plugin-angular-class-ordering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leritas%2Feslint-plugin-angular-class-ordering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Leritas","download_url":"https://codeload.github.com/Leritas/eslint-plugin-angular-class-ordering/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leritas%2Feslint-plugin-angular-class-ordering/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33077917,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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":[],"created_at":"2026-05-13T18:00:54.893Z","updated_at":"2026-05-15T20:01:10.114Z","avatar_url":"https://github.com/Leritas.png","language":"TypeScript","funding_links":[],"categories":["Development Utilities"],"sub_categories":["Linting"],"readme":"# eslint-plugin-angular-class-ordering\n\nESLint plugin focused on **`member-ordering`**: it keeps **Angular class members** (fields and methods) in a consistent order inside `@Component`, `@Directive`, `@Injectable`, and `@Pipe` classes. It understands modern Angular APIs (`inject`, signal-based `input` / `output` / `model`, `signal`, `computed`, queries, and common decorators) and includes **auto-fix** for layout.\n\nTwo **optional** rules ship with the same package — **`prefer-inject-function`** (constructor DI → `inject()`, with fix) and **`forbid-nested-super-injections`** (subclass `super()` / field-init ordering; warn-only). They are **not** part of the default preset so installing the plugin only turns on **member ordering** unless you enable the others yourself.\n\n## Requirements\n\n- **Node.js** `^18.18.0 || ^20.9.0 || \u003e=21.1.0`\n- **ESLint** `^8.57.0 || ^9.0.0`\n- **TypeScript sources** linted with **`@typescript-eslint/parser`** (Angular projects already use this).\n\n## Install\n\n```bash\nnpm install --save-dev eslint @typescript-eslint/parser eslint-plugin-angular-class-ordering\n```\n\n## ESLint flat config (`eslint.config.js`)\n\n```javascript\nconst angularClassOrdering = require('eslint-plugin-angular-class-ordering');\nconst tsParser = require('@typescript-eslint/parser');\n\nmodule.exports = [\n    {\n        files: ['**/*.ts'],\n        languageOptions: {\n            parser: tsParser,\n            parserOptions: {\n                ecmaVersion: 'latest',\n                sourceType: 'module',\n            },\n        },\n        plugins: {\n            'angular-class-ordering': angularClassOrdering,\n        },\n        rules: {\n            ...angularClassOrdering.configs.recommended.rules,\n        },\n    },\n];\n```\n\nThe bundled **`recommended`** config enables only **`member-ordering`** at **error**. It does **not** enable `prefer-inject-function` or `forbid-nested-super-injections`, so you do not get unexpected constructor refactors from `--fix` until you opt in.\n\nTo opt in to the inject-related rules (typical pairing: `prefer-inject-function` as **error**, `forbid-nested-super-injections` as **warn**), add them next to `recommended`:\n\n```javascript\nrules: {\n  ...angularClassOrdering.configs.recommended.rules,\n  'angular-class-ordering/prefer-inject-function': 'error',\n  'angular-class-ordering/forbid-nested-super-injections': 'warn',\n},\n```\n\nFor **`prefer-inject-function`**, set **`autofix: false`** when you want diagnostics without `--fix` rewrites (for example at `warn` severity). ESLint does not pass severity into rule implementations, so this must be configured explicitly. See [prefer-inject-function](docs/rules/prefer-inject-function.md#options) for options and examples.\n\nOverride rule options:\n\n```javascript\nrules: {\n  \"angular-class-ordering/member-ordering\": [\n    \"error\",\n    {\n      decorators: [\"Component\", \"Injectable\"],\n      unknownPlacement: \"last\",\n      readonlyOrdering: false, // optional: keep declaration order within a slot (no readonly-first autofix)\n    },\n  ],\n},\n```\n\n## Legacy config (`.eslintrc.cjs`)\n\n```javascript\nmodule.exports = {\n    overrides: [\n        {\n            files: ['*.ts'],\n            parser: '@typescript-eslint/parser',\n            plugins: ['angular-class-ordering'],\n            rules: {\n                'angular-class-ordering/member-ordering': 'error',\n            },\n        },\n    ],\n};\n```\n\n## Rule documentation\n\n- [member-ordering](docs/rules/member-ordering.md) — class member order and auto-fix layout (**on** in `recommended`)\n- [prefer-inject-function](docs/rules/prefer-inject-function.md) — prefer `inject()` over constructor DI; options `decorators`, `autofix` (**opt-in**)\n- [forbid-nested-super-injections](docs/rules/forbid-nested-super-injections.md) — `super()` / field-init ordering; options `decorators` (**opt-in**)\n\n## Scripts (development)\n\n```bash\nnpm test\nnpm run test:watch\nnpm run lint\nnpm run lint:fix\nnpm run format:check\n```\n\n## Repository\n\nSource and issue tracker: [github.com/Leritas/eslint-plugin-angular-class-ordering](https://github.com/Leritas/eslint-plugin-angular-class-ordering).\n\nGitHub Actions runs `npm test`, `npm run lint`, and `npm run format:check` on pushes and pull requests to `main` / `master` (Node 18, 20, 22).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeritas%2Feslint-plugin-angular-class-ordering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeritas%2Feslint-plugin-angular-class-ordering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeritas%2Feslint-plugin-angular-class-ordering/lists"}