eslint: enable extra rules

no-implicit-coercion, no-extra-boolean-cast, no-invalid-this, logical-assignment-operators, no-unmodified-loop-condition
This commit is contained in:
undefined committed 2023-01-06 00:28:35 +08:00
1 parent 5ac9d930b2
commit 7f51df236a
34 files changed
+100 -96

No files matched your search

+4 -10
View File
@@ -8,16 +8,10 @@ const client = new Client({ node: SystemModel.get('elastic-search.url') || 'http
const indexOmit = ['_id', 'docType', 'data', 'additional_file', 'config', 'stats', 'assign'];
const processDocument = (doc: Partial<ProblemDoc>) => {
if (doc.content) {
doc.content = doc.content.replace(/[[\]【】()()]/g, ' ');
}
if (doc.title) {
doc.title = doc.title.replace(/[[\]【】()()]/g, ' ')
.replace(/([a-zA-Z]{2,})(\d+)/, '$1$2 $1 $2');
}
if (doc.pid) {
doc.pid = doc.pid.replace(/([a-zA-Z]{2,})(\d+)/, '$1$2 $1 $2');
}
doc.content &&= doc.content.replace(/[[\]【】()()]/g, ' ');
doc.title &&= doc.title.replace(/[[\]【】()()]/g, ' ')
.replace(/([a-zA-Z]{2,})(\d+)/, '$1$2 $1 $2');
doc.pid &&= doc.pid.replace(/([a-zA-Z]{2,})(\d+)/, '$1$2 $1 $2');
return _.omit(doc, indexOmit);
};