Skip to content

Commit

Permalink
remuve unused function, see #791
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Sep 20, 2019
1 parent ff56fb0 commit ab14705
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions eslint/rules/getBadTextTester.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,6 @@
module.exports = ( badTexts, context ) => {
'use strict';

/**
* Returns true if the valueText is "good" (not an entry of badTexts).
*
* @param {string} valueText - the string to test
* @param {string|{name:string, regex:RegExp}} badText entry of badTexts
* @returns {boolean}
*/
const reportBadText = ( valueText, badText, tokenLocation ) => {
let failedText = null;
if ( badText.regex instanceof RegExp && badText.regex.test( valueText ) ) {
failedText = badText.name;
}
if ( valueText.indexOf( badText ) >= 0 ) {
failedText = badText;
}

failedText && context.report( {
loc: tokenLocation.start,
message: 'File contains bad text: \'' + failedText + '\''
} );
};

return node => {
const sourceCode = context.getSourceCode();
const codeTokens = sourceCode.getTokens( node );
Expand Down

0 comments on commit ab14705

Please sign in to comment.