Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Rule: alpha-value-notation #75

Closed
1 task done
azat-io opened this issue Mar 1, 2025 · 3 comments
Closed
1 task done

New Rule: alpha-value-notation #75

azat-io opened this issue Mar 1, 2025 · 3 comments
Labels

Comments

@azat-io
Copy link
Contributor

azat-io commented Mar 1, 2025

Rule details

Specify percentage or number notation for alpha-values.

What type of rule is this?

Warns about a potential problem

Example code

There are two ways to set alpha notation.

Number:

.test {
  color: rgb(0 0 0 / 0.5);
  opacity: 1;
}

Percentage:

.test {
  color: rgb(0 0 0 / 50%);
  opacity: 100%;
}

I think it would be good to have a rule to check this.

{
  rules: {
    'alpha-value-notation': ['error', 'percentage'],
  },
}

Participation

  • I am willing to submit a pull request to implement this rule.
@azat-io azat-io added the feature label Mar 1, 2025
@nzakas nzakas added this to Triage Mar 3, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 3, 2025
@nzakas nzakas moved this from Needs Triage to Triaging in Triage Mar 3, 2025
@nzakas
Copy link
Member

nzakas commented Mar 3, 2025

Same question as #76: is there a functional difference between the two syntaxes?

@azat-io
Copy link
Contributor Author

azat-io commented Mar 3, 2025

No difference, just code style.

@nzakas
Copy link
Member

nzakas commented Mar 7, 2025

As noted on #76, we aren't accepting stylistic rules into the plugin. You can always create your own plugin with these rules if you so desire.

@nzakas nzakas closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2025
@github-project-automation github-project-automation bot moved this from Triaging to Complete in Triage Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Complete
Development

No branches or pull requests

2 participants