How to use the mjml-validator.registerMJRule function in mjml-validator

To help you get started, we’ve selected a few mjml-validator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mjmlio / mjml / packages / mjml-core / src / parsers / config.js View on Github external
validators.forEach(file => {
    if (!file) {
      return
    }

    try {
      const filename = path.join(process.cwd(), file)
      const rule = isRelativePath(file) ? require(filename) : require.main.require(file)

      registerMJRule(rule)
    } catch (e) {
      warning(false, `.mjmlconfig file ${file} opened from ${cwd} has an error : ${e}`)
    }
  })
}

mjml-validator

mjml-validator

MIT
Latest version published 3 months ago

Package Health Score

95 / 100
Full package analysis

Similar packages