Documentation comment not found for arrow function
addMultipleKeys
87 return response
88 }
89
90 const addMultipleKeys: AddMultipleKeys = async (newStrings) => { 91 const baseRequest: Array<PatchRequest> = []
92 const dbRequest: Array<PatchRequest> = []
93
Documentation comment not found for arrow function
addSingleKey
63 }
64 return response
65 }
66 const addSingleKey: AddSingleKey = async ({ isDatabaseString, key, text, ...params }) => { 67 const branchId = isDatabaseString ? branches.database : undefined
68 const fileId = isDatabaseString ? undefined : fileIds.main[params.ns ?? 'common']
69 const identifier = key
Documentation comment not found for arrow function
updateMultipleKeys
31 )
32 return response
33 }
34 const updateMultipleKeys: UpdateMultipleStrings = async (updates) => { 35 const baseRequest: PatchRequest[] = []
36 const dbRequest: PatchRequest[] = []
37 for (const { updatedString, isDatabaseString, ...params } of updates) {
Documentation comment not found for arrow function
updateSingleKey
21
22 return crowdinString.find(({ data }) => data.identifier === key)?.data.id
23 }
24 const updateSingleKey: UpdateSingleString = async ({ updatedString, isDatabaseString, ...params }) => { 25 const stringId = params.crowdinId ?? (await getStringIdByKey(params.key, isDatabaseString))
26 invariant(stringId)
27 const { data: response } = await client.sourceStringsApi.editString(
Documentation comment not found for arrow function
getStringIdByKey
9 isDatabaseString ? projectId.dbContent : projectId.base
10
11export const createCommonFns = (client: CrowdinApi) => {
12 const getStringIdByKey = async (key: string, isDatabaseString?: boolean) => { 13 const { data: crowdinString } = await client.sourceStringsApi.listProjectStrings(
14 getProjectId(isDatabaseString),
15 {
Documentation comment not found for arrow function
createCommonFns
8const getProjectId = (isDatabaseString: boolean = false) =>
9 isDatabaseString ? projectId.dbContent : projectId.base
10
11export const createCommonFns = (client: CrowdinApi) => { 12 const getStringIdByKey = async (key: string, isDatabaseString?: boolean) => {
13 const { data: crowdinString } = await client.sourceStringsApi.listProjectStrings(
14 getProjectId(isDatabaseString),
Documentation comment not found for arrow function
getProjectId
5
6import type CrowdinApi from '@crowdin/crowdin-api-client'
7
8const getProjectId = (isDatabaseString: boolean = false) => 9 isDatabaseString ? projectId.dbContent : projectId.base
10
11export const createCommonFns = (client: CrowdinApi) => {
Documentation comment not found for arrow function
addSingleKeyFromNestedFreetextCreate
22export const { addSingleKey, getStringIdByKey, updateMultipleKeys, updateSingleKey } =
23 createCommonFns(crowdinApi)
24
25export const addSingleKeyFromNestedFreetextCreate = async (26 freeText: AddStringFromNestedFreetextCreateParams
27) => {
28 if (freeText.create.tsKey?.create) {
Documentation comment not found for arrow function
generateTranslationKeys
73 return outputData
74}
75
76export const generateTranslationKeys = async (task: PassedTask) => { 77 const prettierConfig = (await prettier.resolveConfig(__filename, { editorconfig: true })) ?? undefined
78 const prettierOpts = prettierConfig ? { ...prettierConfig, parser: 'json' } : undefined
79 const data = await getKeysFromDb()
Documentation comment not found for arrow function
processKeys
55
56type DBKeys = Prisma.PromiseReturnType<typeof getKeysFromDb>[number]['keys']
57
58const processKeys = (keys: DBKeys) => { 59 const outputData: Output = {}
60 for (const item of keys) {
61 if (item.interpolation && isObject(item.interpolationValues)) {
Documentation comment not found for arrow function
getKeysFromDb
37 }
38}
39
40const getKeysFromDb = async () => 41 await prisma.translationNamespace.findMany({
42 where: where(),
43 include: {
Documentation comment not found for arrow function
where
21
22const countKeys = (obj: Output): number => Object.keys(flatten(obj)).length
23
24const where = (): Prisma.TranslationNamespaceWhereInput | undefined => { 25 switch (true) {
26 case !!process.env.EXPORT_ALL: {
27 return undefined
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;
}