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 using classNames 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.
Problem statement
Recently we refactored the main Sourcegraph codebase to be consistent in usage of the classNames utility to create
classNameprop in React Components. To prevent usage of the template literal, we need to create an ESLint rule that communicates to a developer that theclassNamesutil is the preferred approach.Success criteria
classNameprop and show a warning that suggests usingclassNamesutility instead:Things to learn/practice during the implementation
Estimated amount of work
T-shirt size abstract estimate: M.