It's safer to provide an `id` to decorateCooked

It’s safer to provide an id to decorateCooked

diff --git a/assets/javascripts/initializers/extend-for-policy.js.es6 b/assets/javascripts/initializers/extend-for-policy.js.es6
index cc237aa..61305b9 100644
--- a/assets/javascripts/initializers/extend-for-policy.js.es6
+++ b/assets/javascripts/initializers/extend-for-policy.js.es6
@@ -391,7 +391,7 @@ function initializePolicy(api) {
     }
   }
 
-  api.decorateCooked(attachPolicy, { onlyStream: true });
+  api.decorateCooked(attachPolicy, { onlyStream: true, id: 'discouse-policy' });
   api.registerCustomPostMessageCallback("policy_change", policyChanged);
 
   api.modifyClass("component:discourse-topic", {

GitHub sha: 4168afcb

1 Like

This failed prettier, we need to figure out an automatic way to run on plugins in vim just like we do for core.

cc @pmusaraj

My bad. I would very much like a standard way to enforce this in plugins too.

1 Like