for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
export default class SmileyConf {
static getSmileys() {
return JSINFO.SMILEY_CONF;
JSINFO
/** global: JSINFO */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
}
/**
* Regex escape as recommended by MDN
*
* @param {string} string
* @returns {string}
*/
static escapeRegExp(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
* Regex from conf
* @returns {RegExp}
static getRegex() {
const smileyGroups = this.getSmileys().map(smiley => `(${SmileyConf.escapeRegExp(smiley.syntax)})`);
const regexstring = smileyGroups.join('|');
return new RegExp(regexstring);
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.