mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
607 B
28 lines
607 B
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const RuleTester = require('../../tools/eslint').RuleTester;
|
|
const rule = require('../../tools/eslint-rules/no-unescaped-regexp-dot');
|
|
|
|
new RuleTester().run('no-unescaped-regexp-dot', rule, {
|
|
valid: [
|
|
'/foo/',
|
|
String.raw`/foo\./`,
|
|
'/.+/',
|
|
'/.*/',
|
|
'/.?/',
|
|
'/.{5}/',
|
|
String.raw`/\\\./`
|
|
],
|
|
invalid: [
|
|
{
|
|
code: '/./',
|
|
errors: [{ message: 'Unescaped dot character in regular expression' }]
|
|
},
|
|
{
|
|
code: String.raw`/\\./`,
|
|
errors: [{ message: 'Unescaped dot character in regular expression' }]
|
|
}
|
|
]
|
|
});
|
|
|