Skip to content

Plugin Authoring Best Practices

Jonathan Ong edited this page Jan 3, 2014 · 1 revision

Errors

When throwing errors, you must include the .position of the rule or declaration. Example:

if (declaration.name !== 'something') {
  var err = new Error('this declaration name isn\'t "something"')
  err.position = declaration.position
  throw err
}
Clone this wiki locally