npm i prettier prettier-plugin-organize-attributes -D
$DEFAULT.$DEFAULT is not specified they are appended at the end.ASC and DESC by specifing attributeSort.attributeSort is not used.The following files also work out of the box if the plugin is specified:
.html – HTML Example.component.html – Angular Example.vue – Vue Example// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"],
}
Starting with Prettier 3 this is required ⬆️
Read below for writing custom attribute orders and configurations ⤵️
// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"],
"attributeGroups": ["^class$", "^(id|name)$", "$DEFAULT", "^aria-"]
}
// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"],
"attributeGroups": ["$DEFAULT", "^data-"],
"attributeSort": "ASC"
}
// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"],
"attributeGroups": ["^group-a$", "^group-b$", "^group-A$", "^group-B$"],
"attributeIgnoreCase": false
}
// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"]
}
// .prettierrc
{}
// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"],
"attributeGroups": [
"$ANGULAR_OUTPUT",
"$ANGULAR_TWO_WAY_BINDING",
"$ANGULAR_INPUT",
"$ANGULAR_STRUCTURAL_DIRECTIVE"
]
}
// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"],
}
<template>
</template>
<template>
</template>
// .prettierrc
{
"plugins": ["prettier-plugin-organize-attributes"],
"attributeGroups": ["$CODE_GUIDE"]
}
$ claude mcp add prettier-plugin-organize-attributes \
-- python -m otcore.mcp_server <graph>