Skip to content

Rule Request: No magic number #4024

@amadeu01

Description

@amadeu01

New Issue Checklist

New rule request

Please describe the rule idea, format
this issue's title as Rule Request: [Rule Name] and describe:

  1. Why should this rule be added? Share links to existing discussion about what
    the community thinks about this.
    https://eslint.org/docs/latest/rules/no-magic-numbers

  2. Provide several examples of what would and wouldn't trigger violations.

Basically, when you use a number without giving it some context.

Circle()
            .fill(Color.primary.opacity(isAnimate ? 0.1 : 1.0 )) // magic numbers
            .frame(
              width: 10, // magic number
              height: 10
            )
  1. Should the rule be configurable, if so what parameters should be configurable?
    No

  2. Should the rule be opt-in or enabled by default? Why?

It should be optional

Metadata

Metadata

Assignees

No one assigned

    Labels

    rule-requestRequests for a new rules.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions