Skip to content

Commit

Permalink
tools: auto fix custom eslint rule for no-unescaped-regexp-dot
Browse files Browse the repository at this point in the history
Fixing some build errors + added correct output for invalid cases

Refs: nodejs#16636
  • Loading branch information
shobhitchittora committed Nov 1, 2017
1 parent ff01725 commit 0a393ce
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions test/parallel/test-eslint-no-unescaped-regexp-dot.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,18 @@ new RuleTester().run('no-unescaped-regexp-dot', rule, {
'/.*/',
'/.?/',
'/.{5}/',
String.raw`/\\\./`,
RegExp(/^\.$/),
RegExp(/^.+$/),
RegExp(/^\\\.$/),
String.raw`/\\\./`
],
invalid: [
{
code: '/./',
code: String.raw`/./`,
errors: [{ message: 'Unescaped dot character in regular expression' }],
output: '/\\./'
output: String.raw`/\./`
},
{
code: String.raw`/\\./`,
errors: [{ message: 'Unescaped dot character in regular expression' }],
output: String.raw`/\./`,
},
{
code: 'RegExp(/^\\.$/)',
errors: [{ message: 'Unescaped dot character in regular expression' }],
output: RegExp(/^\.$/),
output: String.raw`/\./`
}
]
});

0 comments on commit 0a393ce

Please sign in to comment.