Skip to content

Commit

Permalink
fix(eslint-plugin): [no-base-to-string] ignore Error, URL, and URLSea…
Browse files Browse the repository at this point in the history
…rchParams by default (#5839)
  • Loading branch information
JoshuaKGoldberg committed Oct 24, 2022
1 parent fe80a43 commit 96e1c6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/eslint-plugin/src/rules/no-base-to-string.ts
Expand Up @@ -48,7 +48,7 @@ export default util.createRule<Options, MessageIds>({
},
defaultOptions: [
{
ignoredTypeNames: ['RegExp'],
ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams'],
},
],
create(context, [option]) {
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-plugin/tests/rules/no-base-to-string.test.ts
Expand Up @@ -113,6 +113,9 @@ tag\`\${{}}\`;
return \`\${v}\`;
}
`,
"'' += new Error();",
"'' += new URL();",
"'' += new URLSearchParams();",
],
invalid: [
{
Expand Down

0 comments on commit 96e1c6c

Please sign in to comment.