Documentation comment not found for arrow function
getReadableDate
30 return randDate.toISOString().split("T")[0];
31};
32
33export const getReadableDate = (dateString) => {34 const dateObject = new Date(dateString);
35 const options = { year: "numeric", month: "long", day: "numeric" };
36 const dateTimeFormat = new Intl.DateTimeFormat("en-US", options);
Documentation comment not found for arrow function
generateRandomDate
21 return `${year}-${month}-${day}`;
22};
23
24export const generateRandomDate = () => {25 const currentDate = new Date();
26 const startDate = new Date(1995, 6, 16);
27 const diffTime = currentDate - startDate;
Documentation comment not found for arrow function
changeDateFormat
7};
8
9
10export const changeDateFormat = (date) => {11 const dateArray = date.split("/");
12 const year = dateArray[2];
13 let month = dateArray[1];
Documentation comment not found for arrow function
currentDate
1export const currentDate = () => { 2 const date = new Date();
3 const day = date.getDate();
4 const month = date.getMonth() + 1;
Documentation comment not found for arrow function
searchAPOD
1
2const API_KEY = import.meta.env.VITE_API_KEY
3
4const searchAPOD = async ({queryKey}) => { 5 const date = queryKey[1];
6 const response = await fetch(
7 `https://api.nasa.gov/planetary/apod?api_key=${API_KEY}&date=${date}`
Documentation comment not found for arrow function
Result
1import { getReadableDate } from "../helpers/utils";
2const Result = ({ results }) => { 3
4 if (results.isLoading) {
5 return (
Documentation comment not found for arrow function
Home
16
17
18
19const Home = () => {20 const todaysDate = currentDate();
21 const [date, setDate] = useState(todaysDate);
22
Documentation comment not found for arrow function
Footer
1const Footer = () => ( 2 <footer>
3 <a href="https://www.google.com/search?q=Dapo+adedire" target="_blank" rel="noreferrer">Dapo Adedire</a>
4 <ul>
Documentation comment not found for function declaration
App
15)
16
17
18function App() {19 return (
20 <QueryClientProvider client={queryClient}>
21 <Home />
Description
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
Bad Practice
function sum(a, b) {
return a + b;
}
Recommended
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}