Skip to content

Commit

Permalink
Allow arguments on toString() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Aug 22, 2020
1 parent ab47bb1 commit 5c1c26f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 1 addition & 5 deletions eslint-config/core/best-practices.js
Expand Up @@ -283,11 +283,7 @@ module.exports = {
/**
* https://eslint.org/docs/rules/no-restricted-properties
*/
'no-restricted-properties': [
'error',
{ property: 'prototype', message: 'Use a class instead.' },
{ property: 'toString', message: 'Use String() instread.' },
],
'no-restricted-properties': ['error', { property: 'prototype', message: 'Use a class instead.' }],

/**
* https://eslint.org/docs/rules/no-return-assign
Expand Down
6 changes: 6 additions & 0 deletions eslint-config/core/stylistic-issues.js
Expand Up @@ -368,6 +368,12 @@ module.exports = {
'TemplateLiteral[expressions.length=1][quasis.0.value.raw=""][quasis.1.value.raw=""]',
message: 'Use String() instead.',
},
{
// `value.toString()`
selector: 'CallExpression[callee.property.name="toString"][arguments.length=0]',
message: 'Use String() instead.',
},

{
selector: 'SequenceExpression',
message: 'Split this sequence into multiple statements.',
Expand Down

0 comments on commit 5c1c26f

Please sign in to comment.