Make field required in Custom Module

Is there a field setting to make a form field required when building a custom module?

I searched the docs but came up empty.

check out the contact and subscribe modules on how to use the settings.js file.

thank you @pross. I’ll have a look