Counselllor / Counsellor-Web

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
6 days ago5 months old
456              Name:
457              <input
458                type="text"
459                placeholder={userInfo.firstname + " " + userInfo.surname}460                value={name}
461                onChange={(e) => setName(e.target.value)}
462              />
 71      const userData = await fetchUserData(userUid);
 72      if (userData) {
 73        setUserData(userData);
 74        setName(userData.firstname + " " + userData.surname || "Alex Foam"); 75        setDob(userData.dob || "2000-01-21");
 76        if (userData.profilePic) {
 77          setProfilePic(userData.profilePic);
Unexpected string concatenation
129      const db = getDatabase();
130      await set(ref(db, 'articles/' + articleId), newBlog);
131      await update(ref(db, 'users/' + userId), {
132        articleCreated: (user.articleCreated ? user.articleCreated + ',' : '') + articleId,133      });
134   
135      navigate('/blogs');
Unexpected string concatenation
128    try {
129      const db = getDatabase();
130      await set(ref(db, 'articles/' + articleId), newBlog);
131      await update(ref(db, 'users/' + userId), {132        articleCreated: (user.articleCreated ? user.articleCreated + ',' : '') + articleId,
133      });
134   
Unexpected string concatenation
127
128    try {
129      const db = getDatabase();
130      await set(ref(db, 'articles/' + articleId), newBlog);131      await update(ref(db, 'users/' + userId), {
132        articleCreated: (user.articleCreated ? user.articleCreated + ',' : '') + articleId,
133      });