Skip to content

One rule to set them all #5

@HugoMendes98

Description

@HugoMendes98

The original idea was to have only one rule with a lot of options.
The default is the first option and the specific decorators could override them.

For example:

{
  "rules": {
    "sort-decorators/sort-decorators": ["error", { "direction": "asc" }, { "classes": { "direction": "desc" } }]
  }
}

However, 5 smaller rules have been created to make it easier to overwrite them in the overrides section, without re-writing all:

{
  "overrides": [{ "files": ["src/*.ts"], "rules": { "sort-decorators/sort-on-classes": "error" } }],
  "rules": {
    "sort-decorators/sort-on-classes": "warn"
  }
}

Should it go back to a 1 rule plugin ?

Or add a 6th rule that is the default for all ? (Is it possible in ESLint ?)

Example:

{
  "rules": {
    "sort-decorators/sort-decorators": ["error", { "direction": "asc" }],
    "sort-decorators/sort-on-classes": ["warn", { "direction": "desc" }]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions