• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

protofire / solhint / #1088

18 Apr 2020 03:39PM UTC coverage: 92.43% (-3.9%) from 96.34%
#1088

push

fvictorio
Show a warning when a plugin doesn't export an array

392 of 469 branches covered (83.58%)

0 of 3 new or added lines in 1 file covered. (0.0%)

22 existing lines in 9 files now uncovered.

1050 of 1136 relevant lines covered (92.43%)

118.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/lib/rules/security/avoid-throw.js
1
const BaseChecker = require('./../base-checker')
1✔
2

3
const ruleId = 'avoid-throw'
1✔
4
const meta = {
1✔
5
  type: 'security',
6

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

12
  isDefault: false,
13
  recommended: true,
14
  defaultSetup: 'warn',
15
  fixable: true,
16

17
  schema: null
18
}
19

20
class AvoidThrowChecker extends BaseChecker {
21
  constructor(reporter) {
22
    super(reporter, ruleId, meta)
197✔
23
  }
24

25
  ThrowStatement(node) {
26
    this.error(node, '"throw" is deprecated, avoid to use it', fixer =>
1✔
27
      // we don't use just `node.range` because ThrowStatement includes the semicolon and the spaces before it
28
      // we know that node.range[0] is the 't' of throw
29
      // we're also pretty sure that 'throw' has 5 letters
UNCOV
30
      fixer.replaceTextRange([node.range[0], node.range[0] + 5], 'revert()')
×
31
    )
32
  }
33
}
34

35
module.exports = AvoidThrowChecker
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc