Skip to content

Releases: krishnaagarwal1506/eslint-frontend-rules

v1.1.1

22 Jul 13:15
7701042

Choose a tag to compare

🛠️ New Rule Added

  • Rule Update: The enforce-classname-utility rule now only warns when the className prop in JSX is set using a template string (e.g., className={`foo ${bar}`}), rather than warning for all string literals.
  • Rationale: Template strings are often used for conditional classes, but using a function or library like cn is preferred for readability and maintainability. Plain string literals (e.g., className="foo bar") are now allowed.
  • Documentation: Updated the README to clarify the rule’s intent and provide correct examples for both warnings and allowed usage.

📖 Example

// Warns:
<Component className={`foo ${bar}`} />
<Component className={`btn ${isActive ? 'active' : ''}`} />

// OK:
<Component className={cn('foo', { active })} />
<Component className={someVar} />
<Component className="foo bar" />
<Component className="" /> // allowed by default

v1.0.6

14 Jul 10:55
146fffd

Choose a tag to compare

  • changed the name of package to add prefix eslint-plugin and some more new rules

v1.0.2

11 Jul 13:21
d0557a9

Choose a tag to compare

  • Added new rule that is -> optional fields must come after required in interfaces and types