Skip to content

Commit 4ae24a2

Browse files
committed
Use String instead of toString
1 parent 4a99c2a commit 4ae24a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rules/forbid-elements.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ module.exports = {
106106

107107
if (argument.type === 'Identifier' && /^[A-Z_]/.test(argument.name)) {
108108
reportIfForbidden(argument.name, argument);
109-
} else if (argument.type === 'Literal' && /^[a-z][^.]*$/.test(argument.value.toString())) {
109+
} else if (argument.type === 'Literal' && /^[a-z][^.]*$/.test(String(argument.value))) {
110110
reportIfForbidden(argument.value, argument);
111111
} else if (argument.type === 'MemberExpression') {
112112
reportIfForbidden(context.getSourceCode().getText(argument), argument);

0 commit comments

Comments
 (0)