()
| 13 | module.exports = function (context) { |
| 14 | return { |
| 15 | Program() { |
| 16 | const filename = relative(process.cwd(), context.getFilename()); |
| 17 | const sourceCode = context.getSourceCode(); |
| 18 | const contents = sourceCode.text; |
| 19 | |
| 20 | for (const terms of context.options) { |
| 21 | for (const report of matchForbiddenTerms(filename, contents, terms)) { |
| 22 | const {loc, match, message} = report; |
| 23 | const formattedMatch = cyan(`"${match}"`); |
| 24 | context.report({ |
| 25 | loc, |
| 26 | message: |
| 27 | `Forbidden: ${formattedMatch}.` + |
| 28 | (message ? ` ${addPeriod(message)}` : ''), |
| 29 | }); |
| 30 | } |
| 31 | } |
| 32 | }, |
| 33 | }; |
| 34 | }; |
nothing calls this directly
no test coverage detected