Skip to content

Rule: with-as-style#1974

Description

@anderseknert

Which one do you prefer? 馃槑

allow with input.users as {"ted": "developer"}

or

allow with input.users.ted as "developer"

I think the latter, but with some reservations, like how an object of many keys likely shouldn't be replaced by as many with statements. Anyway, this would be a fun opt-in rule (hence in the custom category) for those who prefer a consistent style in their policy tests, where the rule could be configured for either preference, and have Regal enforce that. The rule would need a few configuration options to account for things like the size of the value and so on, and it would of course be very nice if there was an equivalent fix command / code action to automatically rewrite one form into the other!

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/customruleIssues related to new or existing linter rules

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions