function scopeToId(value) {
  const id = value
    .toLowerCase() // `source.Caddyfile` -> `source.caddyfile`
    // For `c++`
    .replace(/\+/g, 'p')
    .replace(/[. -_]([a-z\d])/g, function (_, /** @type {string} */ $1) {
      return $1.toUpperCase()
    })
  assert.ok(/^[A-Za-z\d.]+$/.test(id), value)
  return id
}
@param {string} value
  Value to convert.
@returns {string}
  Converted value.