Skip to content

[sort-keys-in-type-decorator] Auto sort keys in angular decoratorsΒ #797

Closed
@splincode

Description

@splincode

Description and reproduction of the issue

@Component({
    styleUrls: ['./money.style.less'],
    selector: 'money',
    changeDetection: ChangeDetectionStrategy.OnPush,
    templateUrl: './money.template.html',
})

It would be really cool if we could sort the keys automatically

eslint . --fix

@Component({
    selector: 'money',
    templateUrl: './money.template.html',
    styleUrls: ['./money.style.less'],
    changeDetection: ChangeDetectionStrategy.OnPush,
})
{
  "rules": {
    "@angular-eslint/sort-keys-in-type-decorator": [
       {
          "Component": ["selector", "templateUrl", "styleUrls", "changeDetection"]
       }
    ]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginAngular-specific TypeScript rulestriageThis issue needs to be looked at and categorized by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions