-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Problem statement
Recently we refactored the main Sourcegraph codebase to be consistent in usage of the classNames utility to create className
prop in React Components. To prevent usage of the template literal, we need to create an ESLint rule that communicates to a developer that the classNames
util is the preferred approach.
Success criteria
- The linter rule is created that detects the use of the template literal inside of the
className
prop and show a warning that suggests usingclassNames
utility instead:
// Bad
<div className={`d-flex ${props.classname}`} />
// Good
<div className={classNames('d-flex', props.classname)} />
Things to learn/practice during the implementation
- How to write custom ESLint rules to boost codebase consistency.
Estimated amount of work
T-shirt size abstract estimate: M.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers