const BaseChecker = require('./../base-checker')

const ruleId = 'avoid-throw'
const meta = {
  type: 'security',

  docs: {
    description: `"throw" is deprecated, avoid to use it.`,
    category: 'Security Rules'
  },

  isDefault: false,
  recommended: true,
  defaultSetup: 'warn',

  schema: []
}

class AvoidThrowChecker extends BaseChecker {
  constructor(reporter) {
    super(reporter, ruleId, meta)
  }

  ThrowStatement(node) {
    this.error(node, '"throw" is deprecated, avoid to use it')
  }
}

module.exports = AvoidThrowChecker

@@ -279,16 +279,33 @@
  'warn',
+%0A  fixable: true,
 %0A%0A  sche
@@ -511,16 +511,96 @@
  use it'
+, fixer =%3E %7B%0A      return %5Bfixer.replaceTextRange(node.range, 'revert()')%5D%0A    %7D
 )%0A  %7D%0A%7D%0A

Implement fixer in `avoid-throw` rule