Releases: krishnaagarwal1506/eslint-frontend-rules
Releases · krishnaagarwal1506/eslint-frontend-rules
v1.1.1
🛠️ New Rule Added
- Rule Update: The
enforce-classname-utilityrule now only warns when theclassNameprop 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
cnis 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 defaultv1.0.6
- changed the name of package to add prefix
eslint-pluginand some more new rules
v1.0.2
- Added new rule that is -> optional fields must come after required in interfaces and types