{"id":44665513,"url":"https://github.com/heap-code/eslint-plugin-sort-attribute-content","last_synced_at":"2026-02-15T00:21:27.951Z","repository":{"id":179704320,"uuid":"661823719","full_name":"heap-code/eslint-plugin-sort-attribute-content","owner":"heap-code","description":"An ESLint plugin to sort HTML attribute content (such as `class`)","archived":false,"fork":false,"pushed_at":"2026-02-06T00:58:15.000Z","size":2182,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-06T10:46:47.800Z","etag":null,"topics":["attribute","eslint","eslintplugin","html","sort"],"latest_commit_sha":null,"homepage":"","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/heap-code.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-07-03T18:27:33.000Z","updated_at":"2026-02-06T00:57:05.000Z","dependencies_parsed_at":"2023-12-20T09:49:26.232Z","dependency_job_id":"905a0c54-dfd6-4357-a74c-e6185184a438","html_url":"https://github.com/heap-code/eslint-plugin-sort-attribute-content","commit_stats":null,"previous_names":["heap-code/eslint-plugin-sort-attribute-content"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/heap-code/eslint-plugin-sort-attribute-content","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heap-code%2Feslint-plugin-sort-attribute-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heap-code%2Feslint-plugin-sort-attribute-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heap-code%2Feslint-plugin-sort-attribute-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heap-code%2Feslint-plugin-sort-attribute-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heap-code","download_url":"https://codeload.github.com/heap-code/eslint-plugin-sort-attribute-content/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heap-code%2Feslint-plugin-sort-attribute-content/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29461775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T22:42:09.113Z","status":"ssl_error","status_checked_at":"2026-02-14T22:42:05.053Z","response_time":53,"last_error":"SSL_read: 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":["attribute","eslint","eslintplugin","html","sort"],"created_at":"2026-02-15T00:21:25.284Z","updated_at":"2026-02-15T00:21:27.947Z","avatar_url":"https://github.com/heap-code.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-sort-attribute-content\n\n[![CI](https://github.com/heap-code/eslint-plugin-sort-attribute-content/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/heap-code/eslint-plugin-sort-attribute-content/actions/workflows/ci.yml)\n[![npm version](https://img.shields.io/npm/v/eslint-plugin-sort-attribute-content)](https://www.npmjs.com/package/eslint-plugin-sort-attribute-content)\n![Code coverage](.badges/code/coverage.svg)\n\nAn ESLint plugin to sort attribute content in HTML\n\n\u003e If you are using [Tailwind](https://tailwindcss.com/) and only want to lint the classnames,\n\u003e then the [eslint-plugin-tailwindcss](https://www.npmjs.com/package/eslint-plugin-tailwindcss)\n\u003e is probably a better choice.\n\n## Installation\n\nFirst, `eslint` must be installed:\n\n```bash\nnpm i --save-dev eslint\n```\n\nThen, `eslint-plugin-sort-attribute-content` can be installed:\n\n```bash\nnpm i --save-dev eslint-plugin-sort-attribute-content\n```\n\n## Usage\n\nA parser must be set to use this plugin:\n\n```json\n{\n  \"parser\": \"@html-eslint/parser\"\n}\n```\n\n\u003e Go to the [parsers section](#parsers) to display the list of available parsers.\n\nThe plugin can then be activated by adding `sort-attribute-content` to the `plugins` property:\n\n```json\n{\n  \"plugins\": [\"sort-attribute-content\"]\n}\n```\n\nThe rule can be defined as follows:\n\n```json\n{\n  \"rules\": {\n    \"sort-attribute-content/sort-attribute-content\": [\"error\", { \"attributes\": \"class\" }]\n  }\n}\n```\n\n\u003e All this configuration can be done on a `override` section:\n\u003e \u003chttps://eslint.org/docs/latest/use/configure/configuration-files#how-do-overrides-work\u003e\n\n### Parsers\n\nThe plugin can be used with multiple parsers.\n\n#### HTML\n\nA _regular_ HTML parser can be used for any HTML files.  \nThe parser [@html-eslint/parser](https://www.npmjs.com/package/@html-eslint/parser)\nshould be installed first:\n\n```bash\nnpm i -D @html-eslint/parser\n```\n\nThen set in the configuration file:\n\n```json\n{\n  \"parser\": \"@html-eslint/parser\"\n}\n```\n\n#### Angular\n\nThis plugin can be used with the [Angular framework](https://angular.io/).  \nThe parser [@angular-eslint/template-parser](https://www.npmjs.com/package/@angular-eslint/template-parser)\nshould be installed first:\n\n```bash\nnpm i -D @angular-eslint/template-parser\n```\n\nThen set in the configuration file:\n\n```json\n{\n  \"parser\": \"@angular-eslint/template-parser\"\n}\n```\n\n\u003e **Note**:  \n\u003e It only works for text attributes.\n\u003e\n\u003e ```angular2html\n\u003e \u003cdiv class=\"a b c\" [title]=\"'d e f'\"\u003e\u003c/div\u003e\n\u003e             ^^^^^\n\u003e ```\n\n#### React\n\nThis plugin can be used with the [React library](https://react.dev/).  \nESLint must first be configured to read React.  \n\u003e [How to configure?](https://github.com/jsx-eslint/eslint-plugin-react#configuration-legacy-eslintrc-)\n\nOnce enabled, it will work on `jsx` and `tsx` files.\n\n\u003e Do not forget to set the [typescript parser](https://typescript-eslint.io/packages/parser/)\n\u003e for `tsx` files.\n\u003e\n\u003e Install:\n\u003e\n\u003e ```bash\n\u003e npm i -D @typescript-eslint/parser\n\u003e ```\n\u003e\n\u003e Then set in the configuration file:\n\u003e\n\u003e ```json\n\u003e {\n\u003e   \"parser\": \"@typescript-eslint/parser\"\n\u003e }\n\u003e ```\n\nIt might be useful to enable the rule only on these files:\n\n```json\n{\n  \"overrides\": [\n    {\n      \"files\": [\"*.jsx\", \"*.tsx\"],\n      \"rules\": {\n        \"sort-attribute-content/sort-attribute-content\": [\"error\", { \"attributes\": \"className\" }]\n      }\n    }\n  ]\n}\n```\n\n\u003e **Note**:  \n\u003e It only works for literal text attributes.\n\u003e\n\u003e ```tsx\n\u003e return \u003cdiv className=\"a b c\" title={title} /\u003e\n\u003e                        ^^^^^\n\u003e ```\n\n## Rules\n\n\u003c!-- begin auto-generated rules list --\u003e\n\n🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\n\n| Name                                                           | 🔧 |\n| :------------------------------------------------------------- | :- |\n| [sort-attribute-content](docs/rules/sort-attribute-content.md) | 🔧 |\n\n\u003c!-- end auto-generated rules list --\u003e\n\n## Releases\n\nSee information about breaking changes and release notes [here](https://github.com/heap-code/eslint-plugin-sort-attribute-content/blob/HEAD/CHANGELOG.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheap-code%2Feslint-plugin-sort-attribute-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheap-code%2Feslint-plugin-sort-attribute-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheap-code%2Feslint-plugin-sort-attribute-content/lists"}