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

Create option to extend rule: no-unknown-animations #7665

Open
darkgreentree opened this issue Apr 27, 2024 · 0 comments
Open

Create option to extend rule: no-unknown-animations #7665

darkgreentree opened this issue Apr 27, 2024 · 0 comments
Labels
status: needs discussion triage needs further discussion

Comments

@darkgreentree
Copy link

darkgreentree commented Apr 27, 2024

What is the problem you're trying to solve?

Taken from: #7593

Use case: 1. it is way easier to write in our mother language instead of mandatory in english. To train people is also easier. So the CSS files are being written in spanish in this context, and converted to english using build tool like Vite + postCSS. Vite has been improving this area recently, so currently the conversion happens in real-time and it works even in SSR/server. 2. Stylelint can lint CSS files written in spanish, because many of its rules have options to add spanish words that mirror the english ones. However, a few rules consider only hardcoded english values. These rules end up being useless to lint spanish files, unless I also lint the built files and jump back and forth fixing things.

Excellent examples of rules that already exist with options to extend its functioning:

  • "custom-property-pattern" searches for a regexp in characters with accents : "^([a-zÀ-ÖØ-öø-ÿ][a-z0-9À-ÖØ-öø-ÿ])(--[a-z0-9À-ÖØ-öø-ÿ]+)$" instead of only english characters: "^([a-z][a-z0-9])(--[a-z0-9]+)$" 👍

  • "function-url-scheme-disallowed-list" searches for spanish functions in the array instead of only english URL scheme: ["file", "archivo"] 👍

  • "property-allowed-list" searches for spanish properties in the array instead of only english properties: ["border", "borde", "margin", "margen", "padding", "relleno"] 👍

  • "selector-pseudo-element-disallowed-list" searches for spanish pseudo-elements in the array instead of only english pseudo-elements: ["después", "after", "antes", "before"] 👍

Now let's see the following rule that lacks an option to extend it:

What solution would you like to see?

  • "no-unknown-animations" link searches only for animation or animation-name property. 👎 It could have an option to search for additional properties:
"no-unknown-animations": [
    true,
    {
      "additionalProperties/animationPropertiesToConsider": [ "animation", "animation-name", "animación", "nombre-animación" ]     <== new option suggested
      "message": "Nome de animação \"%s\" inesperadamente desconhecido"
     }
  ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs discussion triage needs further discussion
Development

No branches or pull requests

2 participants