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

Rule Change: Allow for configurable properties #36

Open
1 task
bradgarropy opened this issue Dec 19, 2024 · 0 comments
Open
1 task

Rule Change: Allow for configurable properties #36

bradgarropy opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@bradgarropy
Copy link

What rule do you want to change?

no-invalid-properties

What change do you want to make?

Generate fewer warnings

How do you think the change should be implemented?

A new option

Example code

@layer utilities {
  .text-shadow-2 {
    text-shadow: 2px 2px theme('colors.purple.400');
  }
  .text-shadow-3 {
    text-shadow: 3px 3px theme('colors.purple.400');
  }
}

What does the rule currently do for this code?

Here is a minimal reproduction of the current state of things.
https://stackblitz.com/edit/no-irregular-whitespace-ey1hdv5b

Currently, the rule shows an error, as it does not understand Tailwind's custom theme property.

/home/projects/better-tailwind-support/tailwind.css
  15:26  error  Invalid value '2px 2px theme("colors.purple.400")' for property 'text-shadow'. Expected none | <shadow-t>#  css/no-invalid-properties
  18:26  error  Invalid value '3px 3px theme("colors.purple.400")' for property 'text-shadow'. Expected none | <shadow-t>#  css/no-invalid-properties

What will the rule do after it's changed?

We should introduce a new option to the rule, so we can add other supported properties, like Tailwind's theme property.

I would expect the configuration to look something like this:

"css/no-invalid-properties": ["error", "theme", "other", ...]

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

/cc @JoshuaKGoldberg

@bradgarropy bradgarropy added the enhancement New feature or request label Dec 19, 2024
@fasttime fasttime added this to Triage Dec 27, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs Triage
Development

No branches or pull requests

1 participant