'trender' is assigned a value but never used. Allowed unused vars must match /^_/u
3import Carousel from "../../Carousel/Carousel";
4
5const Trending = ({}) => {
6 const { trendingApiData, trendingIsLoading, trender } = useContext(context); 7 // console.log("...trender", trender);
8 trendingApiData &&
9 console.log("...Trending apiData in Tending", trendingApiData);
'Carousel' is defined but never used. Allowed unused vars must match /^_/u
1import React, { useContext } from "react";
2import context from "../../../store/context";
3import Carousel from "../../Carousel/Carousel"; 4import SlickCarousel from "../../../SlickCarousel";
5
6const Love = ({}) => {
'trender' is assigned a value but never used. Allowed unused vars must match /^_/u
3import Carousel from "../../Carousel/Carousel";
4
5const Comedy = ({}) => {
6 const { comedyApiData, comedyIsLoading, trender } = useContext(context); 7 // console.log("...trender", trender);
8 comedyApiData && console.log("...Trending apiData in Tending", comedyApiData);
9
'useContext' is defined but never used. Allowed unused vars must match /^_/u
1import React, { useContext } from "react"; 2import BodyStyle from "./BodyStyle";
3import Trending from "./Trending/Trending";
4import TrendingApiProvider from "../../Api/Trending/TrendingApi";
'actioneer' is assigned a value but never used. Allowed unused vars must match /^_/u
3import Carousel from "../../Carousel/Carousel";
4
5const Action = ({}) => {
6 const { actionApiData, actionIsLoading, actioneer } = useContext(context); 7 // console.log("...trender", trender);
8
9 return (
'Component' is defined but never used. Allowed unused vars must match /^_/u
1import React, { Component } from "react"; 2import Slider from "react-slick";
3import { CarouselStyle } from "./components/Carousel/CarouselStyle";
4
'Carousel' is defined but never used. Allowed unused vars must match /^_/u
1import React from "react";
2import Body from "./components/Body/Body";
3import Header from "./components/Header/Header";
4import Carousel from "./components/Carousel/Carousel"; 5
6import "slick-carousel/slick/slick.css";
7import "slick-carousel/slick/slick-theme.css";
'useMemo' is defined but never used. Allowed unused vars must match /^_/u
1import { useEffect, useState, useCallback, useMemo } from "react"; 2import context from "../../store/context";
3// import ContextProvider from "../../store/ContextProvider";
4
'useMemo' is defined but never used. Allowed unused vars must match /^_/u
1import { useEffect, useState, useCallback, useMemo } from "react"; 2import context from "../../store/context";
3// import ContextProvider from "../../store/ContextProvider";
4
'useMemo' is defined but never used. Allowed unused vars must match /^_/u
1import { useEffect, useState, useCallback, useMemo } from "react"; 2import context from "../../store/context";
3// import ContextProvider from "../../store/ContextProvider";
4
'useMemo' is defined but never used. Allowed unused vars must match /^_/u
1import { useEffect, useState, useCallback, useMemo } from "react"; 2import context from "../../store/context";
3// import ContextProvider from "../../store/ContextProvider";
4
Description
Found variables that are declared but not used anywhere.
NOTE: In browser applications, DeepSource recommends the use of ESModules over regular
text/javascript
scripts. Currently, we don't support variables that are not explicitly exported, and are injected into other scripts by being included in an HTML file
Unused variables are most often the result of incomplete refactoring. They can lead to confusing code and minor performance hitches.
NOTE: If you have intentionally left a variable unused, we suggest you to prefix the variable name with a _
to prevent them from being flagged by DeepSource.
Bad Practice
// Write-only variables are not considered as used.
let y = 10;
y = 5;
// A variable that modifies only itself isn't considered used.
let z = 0;
z = z + 1;
// Unused argument
(function(x) {
return 5;
})();
// Unused recursive functions also raise this issue.
function fact(n) {
if (n < 2) return 1;
return n * fact(n - 1);
}
// When a function definition destructures an array,
// unused entries from the array also cause warnings.
function getY([x, y]) {
return y;
}
Recommended
let x = 10;
alert(x);
((arg1) => {
return arg1;
})();
let myFunc;
myFunc = (n) => {
// this is legal
if (n < 0) myFunc();
};
// this is also considered legal
console.log(declaredLater);
var declaredLater;
// Only the second argument from the descructured array is used.
function getY([, y]) {
return y;
}