summaryrefslogtreecommitdiff
path: root/ext/js/language/translator.js
diff options
context:
space:
mode:
authorJames Maa <jmaa@berkeley.edu>2024-05-31 08:06:52 -0700
committerGitHub <noreply@github.com>2024-05-31 15:06:52 +0000
commit76ca08bd59f0e8bfa1bb20ac813f48e7ab241265 (patch)
treebdba43d9ba704885383c7f308c6fe3f574c647c5 /ext/js/language/translator.js
parentb3f54747eb2694bdc90bce72e5532e99d374ef08 (diff)
Allow trailing commas in ESLint (#1013)
* Update comma-dangle rule * Fix dangling commas
Diffstat (limited to 'ext/js/language/translator.js')
-rw-r--r--ext/js/language/translator.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/ext/js/language/translator.js b/ext/js/language/translator.js
index 51e1823b..e9490346 100644
--- a/ext/js/language/translator.js
+++ b/ext/js/language/translator.js
@@ -196,7 +196,7 @@ export class Translator {
hasReading,
frequency: frequencyValue,
displayValue,
- displayValueParsed
+ displayValueParsed,
});
}
return results;
@@ -354,7 +354,7 @@ export class Translator {
const inflectionRuleChainCandidates = algorithmChains.map(({inflectionRules: algInflections}) => {
return {
source: /** @type {import('dictionary').InflectionSource} */ (algInflections.length === 0 ? 'dictionary' : 'both'),
- inflectionRules: [...algInflections, ...inflectionRules]
+ inflectionRules: [...algInflections, ...inflectionRules],
};
});
@@ -458,7 +458,7 @@ export class Translator {
/** @type {import('dictionary').InflectionRuleChainCandidate} */
const inflectionRuleChainCandidate = {
source: 'algorithm',
- inflectionRules: trace.map((frame) => frame.transform)
+ inflectionRules: trace.map((frame) => frame.transform),
};
deinflections.push(this._createDeinflection(rawSource, source, transformedText, conditions, [inflectionRuleChainCandidate]));
}
@@ -609,7 +609,7 @@ export class Translator {
if (typeof group === 'undefined') {
group = {
ids: new Set(),
- dictionaryEntries: []
+ dictionaryEntries: [],
};
sequenceList.push({query: sequence, dictionary});
groupedDictionaryEntries.push(group);
@@ -686,7 +686,7 @@ export class Translator {
let target = targetMap.get(key);
if (typeof target === 'undefined') {
target = {
- groups: []
+ groups: [],
};
targetMap.set(key, target);
termList.push({term, reading});
@@ -1124,7 +1124,7 @@ export class Translator {
hasReading,
frequencyValue,
displayValue,
- displayValueParsed
+ displayValueParsed,
));
}
}
@@ -1147,7 +1147,7 @@ export class Translator {
position,
nasalPositions,
devoicePositions,
- tags: tags2
+ tags: tags2,
});
}
for (const {pronunciations, headwordIndex} of targets) {
@@ -1157,7 +1157,7 @@ export class Translator {
dictionary,
dictionaryIndex,
dictionaryPriority,
- pitches
+ pitches,
));
}
}
@@ -1176,7 +1176,7 @@ export class Translator {
phoneticTranscriptions.push({
type: 'phonetic-transcription',
ipa,
- tags: tags2
+ tags: tags2,
});
}
for (const {pronunciations, headwordIndex} of targets) {
@@ -1186,7 +1186,7 @@ export class Translator {
dictionary,
dictionaryIndex,
dictionaryPriority,
- phoneticTranscriptions
+ phoneticTranscriptions,
));
}
}
@@ -1221,7 +1221,7 @@ export class Translator {
character,
frequency,
displayValue,
- displayValueParsed
+ displayValueParsed,
));
}
break;
@@ -1389,7 +1389,7 @@ export class Translator {
order: (typeof order === 'number' ? order : 0),
score: (typeof score === 'number' ? score : 0),
dictionary,
- value
+ value,
};
}
@@ -1427,7 +1427,7 @@ export class Translator {
tags: [],
stats,
definitions,
- frequencies: []
+ frequencies: [],
};
}
@@ -1451,7 +1451,7 @@ export class Translator {
score: (typeof score === 'number' ? score : 0),
content: (typeof notes === 'string' && notes.length > 0 ? [notes] : []),
dictionaries: [dictionary],
- redundant: false
+ redundant: false,
};
}
@@ -1508,7 +1508,7 @@ export class Translator {
sequences,
isPrimary,
tags,
- entries
+ entries,
};
}
@@ -1567,7 +1567,7 @@ export class Translator {
headwords,
definitions,
pronunciations: [],
- frequencies: []
+ frequencies: [],
};
}
@@ -1595,7 +1595,7 @@ export class Translator {
dictionary,
id,
sequence: rawSequence,
- rules
+ rules,
} = databaseEntry;
// Cast is safe because getDeinflections filters out deinflection definitions
const contentDefinitions = /** @type {import('dictionary-data').TermGlossaryContent[]} */ (definitions);
@@ -1623,7 +1623,7 @@ export class Translator {
sourceTermExactMatchCount,
maxOriginalTextLength,
[this._createTermHeadword(0, term, reading, [source], headwordTagGroups, rules)],
- [this._createTermDefinition(0, [0], dictionary, dictionaryIndex, dictionaryPriority, id, score, [sequence], isPrimary, definitionTagGroups, contentDefinitions)]
+ [this._createTermDefinition(0, [0], dictionary, dictionaryIndex, dictionaryPriority, id, score, [sequence], isPrimary, definitionTagGroups, contentDefinitions)],
);
}
@@ -1700,7 +1700,7 @@ export class Translator {
sourceTermExactMatchCount,
maxOriginalTextLength,
headwordsArray,
- definitions
+ definitions,
);
}