Przeglądaj źródła

update no-populate.grit

Yuki Takei 3 miesięcy temu
rodzic
commit
5236fdfdcb

+ 5 - 1
apps/app/src/server/models/.biome/plugins/no-populate.grit

@@ -1,7 +1,11 @@
 engine biome(1.0)
 language js(typescript)
 
-`$obj.populate($args)` where {
+// Match any populate method call
+or {
+  `$obj.populate($_)`,
+  `$obj.populate<$type>($_)`
+} where {
   register_diagnostic(
     span=$obj,
     message="The 'populate' method should not be called in model modules. Consider restructuring your code to avoid using populate in model files."

+ 1 - 1
apps/app/src/server/models/page.ts

@@ -1426,7 +1426,7 @@ schema.methods.calculateAndUpdateLatestRevisionBodyLength = async function (
     return;
   }
 
-  // eslint-disable-next-line rulesdir/no-populate
+  // biome-ignore lint/plugin: allow populate for backward compatibility
   const populatedPageDocument = await this.populate<PageDocument>(
     'revision',
     'body',