1nwf / Produx-v2

Use valid anchors JS-0739
Anti-pattern
Minor
8 months ago2 years old
The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
10
11  return (
12    <Link href={`products/${product.name}`}>
13      <a>14        <div className="hover:bg-gray-200 rounded-box flex items-center p-2 active:bg-gray-300">
15          {product.images && (
16            <img src={product.images[0]} className="h-16 w-16 object-contain" />
The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
167              query: { name: product.name },
168            }}
169          >
170            <a>171              <div
172                className="p-4 px-6 hover:bg-gray-200 hover:cursor-pointer mx-auto rounded-2xl my-2 w-[15vw]"
173                style={{
The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
146                  query: { name: product.name, channel: e },
147                }}
148              >
149                <a>150                  <div
151                    className="p-4 px-6 hover:bg-gray-200 hover:cursor-pointer mx-auto rounded-2xl my-2 w-[15vw] "
152                    style={{
The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
124              query: { name: product.name },
125            }}
126          >
127            <a>128              <div
129                className="p-4 px-6 hover:bg-gray-200 hover:cursor-pointer mx-auto rounded-2xl my-2 w-[15vw] "
130                style={{
The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
 85                } p-2 m-0 cursor-pointer rounded-xl active:text-white`}
 86                onClick={followHandler}
 87              >
 88                <a>{follow ? "unfollow" : "follow"}</a> 89              </li>
 90            </ul>
 91          </div>