Skip to content

Commit 264b434

Browse files
authored
feat: add d and v flags to no-unexpected-multiline (#21305)
1 parent 1696682 commit 264b434

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

‎lib/rules/no-unexpected-multiline.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
},
4040

4141
create(context) {
42-
const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u;
42+
const REGEX_FLAG_MATCHER = /^[dgimsuvy]+$/u;
4343

4444
const sourceCode = context.sourceCode;
4545

‎tests/lib/rules/no-unexpected-multiline.js‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,36 @@ ruleTester.run("no-unexpected-multiline", rule, {
359359
},
360360
],
361361
},
362+
{
363+
code: `
364+
foo
365+
/bar/d.test(baz)
366+
`,
367+
errors: [
368+
{
369+
line: 3,
370+
column: 17,
371+
endLine: 3,
372+
endColumn: 18,
373+
messageId: "division",
374+
},
375+
],
376+
},
377+
{
378+
code: `
379+
foo
380+
/bar/v.test(baz)
381+
`,
382+
errors: [
383+
{
384+
line: 3,
385+
column: 17,
386+
endLine: 3,
387+
endColumn: 18,
388+
messageId: "division",
389+
},
390+
],
391+
},
362392

363393
// https://github.com/eslint/eslint/issues/11650
364394
{

0 commit comments

Comments
 (0)