feat: add support for invalid utility class diagnostics#1496
Open
felicijus wants to merge 11 commits into
Open
feat: add support for invalid utility class diagnostics#1496felicijus wants to merge 11 commits into
felicijus wants to merge 11 commits into
Conversation
e371c5e to
9cc237b
Compare
| let index = 0 | ||
| for (let i = 0; i < parts.length; i++) { | ||
| if (i % 2 === 0 && !blocklist.includes(parts[i])) { | ||
| if (i % 2 === 0 && parts[i] && parts[i] !== '$' && !blocklist.includes(parts[i])) { |
Contributor
There was a problem hiding this comment.
This is a very js-specific thing. It probably doesn't belong here. Not sure where though.
Will need to think about this 🤔
54832c3 to
e5b69ef
Compare
…e find.ts getClassNamesInClassList logic for '$' handling
…eck for deprecated v0–v2
f26117c to
14165ef
Compare
… for invalid classes - Updated the `isClassValid` function to streamline the validation process for utility classes in Tailwind CSS. - Removed unnecessary complexity related to design system compilation in version 4. - Introduced a new test suite for invalid class diagnostics, covering various scenarios including HTML, JSX, CSS, and Vue files. - Ensured that the tests validate the expected diagnostics for both valid and invalid utility classes. feat: enhance invalid class diagnostics with comprehensive test cases and refactor test structure feat: mark unused invalidClass test folder refactor: simplify class validation logic and add comprehensive tests for invalid classes - Updated the `isClassValid` function to streamline the validation process for utility classes in Tailwind CSS. - Removed unnecessary complexity related to design system compilation in version 4. - Introduced a new test suite for invalid class diagnostics, covering various scenarios including HTML, JSX, CSS, and Vue files. - Ensured that the tests validate the expected diagnostics for both valid and invalid utility classes.
14165ef to
687f6ab
Compare
Author
|
@thecrypticace can you please find the time to review this so we can get this merged, I thinks it a valuable addition to the extension. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a new invalidClass diagnostic to flag unrecognized Tailwind utility classes, helping catch typos and invalid utilities.
Changes
'info'option alongside'ignore','warning','error'Tests
invalidClassinbasicandv4/basicfixturespackages\tailwindcss-language-server\tests\diagnostics\diagnostics.test.jsUsage
Configure in VSCode settings:
{ "tailwindCSS.lint.invalidClass": "info" }Based on:
#872 (comment)
Linked:
#872