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

fix non-autofixable biome lint errors

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

+ 7 - 9
packages/core/src/models/devided-page-path.ts

@@ -1,10 +1,10 @@
 import * as pathUtils from '../utils/path-utils';
 
 // https://regex101.com/r/BahpKX/2
-const PATTERN_INCLUDE_DATE = /^(.+\/[^/]+)\/(\d{4}|\d{4}\/\d{2}|\d{4}\/\d{2}\/\d{2})$/;
+const PATTERN_INCLUDE_DATE =
+  /^(.+\/[^/]+)\/(\d{4}|\d{4}\/\d{2}|\d{4}\/\d{2}\/\d{2})$/;
 
 export class DevidedPagePath {
-
   isRoot: boolean;
 
   isFormerRoot: boolean;
@@ -14,7 +14,6 @@ export class DevidedPagePath {
   latter: string;
 
   constructor(path: string, skipNormalize = false, evalDatePath = false) {
-
     this.isRoot = false;
     this.isFormerRoot = false;
     this.former = '';
@@ -40,11 +39,11 @@ export class DevidedPagePath {
     }
 
     let PATTERN_DEFAULT = /^((.*)\/(?!em>))?(.+)$/; // this will ignore em's end tags
-    try { // for non-chrome browsers
-      // eslint-disable-next-line regex/invalid
-      PATTERN_DEFAULT = /^((.*)(?<!<)\\/)?(.+)$/; // https://regex101.com/r/HJNvMW/1
-    }
-    catch (err) {
+    try {
+      // for non-chrome browsers
+      // biome-ignore lint/complexity/useRegexLiterals: ignore
+      PATTERN_DEFAULT = new RegExp('^((.*)(?<!<)\\/)?(.+)$'); // https://regex101.com/r/HJNvMW/1
+    } catch (err) {
       // lookbehind regex is not supported on non-chrome browsers
     }
 
@@ -55,5 +54,4 @@ export class DevidedPagePath {
       this.latter = matchDefault[3];
     }
   }
-
 }

+ 2 - 0
packages/core/src/models/vo/error-apiv3.ts

@@ -1,12 +1,14 @@
 export class ErrorV3 extends Error {
   code: string;
 
+  // biome-ignore lint/suspicious/noExplicitAny: ignore
   args?: any;
 
   constructor(
     message = '',
     code = '',
     stack = undefined,
+    // biome-ignore lint/suspicious/noExplicitAny: ignore
     args: any = undefined,
   ) {
     super(); // do not provide message to the super constructor

+ 1 - 0
packages/core/src/utils/page-path-utils/index.ts

@@ -212,6 +212,7 @@ export const omitDuplicateAreaPathFromPaths = (paths: string[]): string[] => {
  * @param paths paths to be tested
  * @returns omitted paths
  */
+// biome-ignore lint/suspicious/noExplicitAny: ignore
 export const omitDuplicateAreaPageFromPages = (pages: any[]): any[] => {
   return pages.filter((page) => {
     const isDuplicate = pages.some((p) =>