Просмотр исходного кода

fix non-autofixable biome errors

Futa Arai 5 месяцев назад
Родитель
Сommit
f722331fac

+ 2 - 2
apps/app/src/server/models/obsolete-page.js

@@ -144,7 +144,7 @@ export const getPageSchema = (crowi) => {
     }
 
     // comparing ObjectId with string
-    // eslint-disable-next-line eqeqeq
+    // biome-ignore lint/suspicious/noDoubleEquals: ignore
     return this.latestRevision == this.revision._id.toString();
   };
 
@@ -175,7 +175,7 @@ export const getPageSchema = (crowi) => {
 
     const revision = this.latestRevision || this.revision._id;
     // comparing ObjectId with string
-    // eslint-disable-next-line eqeqeq
+    // biome-ignore lint/suspicious/noDoubleEquals: ignore
     if (revision != previousRevision) {
       return false;
     }

+ 5 - 2
apps/app/src/server/models/page.ts

@@ -899,7 +899,7 @@ schema.statics.findTargetAndAncestorsByPathOrId = async function (
   user,
   userGroups,
 ): Promise<TargetAndAncestorsResult> {
-  let path;
+  let path: string;
   if (!hasSlash(pathOrId)) {
     const _id = pathOrId;
     const page = await this.findOne({ _id });
@@ -926,7 +926,9 @@ schema.statics.findTargetAndAncestorsByPathOrId = async function (
 
   // no same path pages
   const ancestorsMap = new Map<string, PageDocument>();
-  _targetAndAncestors.forEach((page) => ancestorsMap.set(page.path, page));
+  _targetAndAncestors.forEach((page) => {
+    ancestorsMap.set(page.path, page);
+  });
   const targetAndAncestors = Array.from(ancestorsMap.values());
   const rootPage = targetAndAncestors[targetAndAncestors.length - 1];
 
@@ -1027,6 +1029,7 @@ schema.statics.recountDescendantCount = async function (
         },
         sumOfDocsCount: {
           $sum: {
+            // biome-ignore lint/suspicious/noThenProperty: ignore
             $cond: { if: { $eq: ['$isEmpty', true] }, then: 0, else: 1 }, // exclude isEmpty true page from sumOfDocsCount
           },
         },

+ 2 - 2
apps/app/src/server/models/password-reset-order.ts

@@ -58,8 +58,8 @@ schema.statics.generateOneTimeToken = () => {
 };
 
 schema.statics.createPasswordResetOrder = async function (email) {
-  let token;
-  let duplicateToken;
+  let token: string;
+  let duplicateToken: PasswordResetOrderDocument | null = null;
 
   do {
     token = this.generateOneTimeToken();

+ 2 - 2
apps/app/src/server/models/user-registration-order.ts

@@ -55,8 +55,8 @@ schema.statics.generateOneTimeToken = () => {
 };
 
 schema.statics.createUserRegistrationOrder = async function (email) {
-  let token;
-  let duplicateToken;
+  let token: string;
+  let duplicateToken: UserRegistrationOrderDocument | null = null;
 
   do {
     token = this.generateOneTimeToken();