File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,12 @@ module.exports = {
278278 meta : {
279279 type : "problem" ,
280280
281+ defaultOptions : [
282+ {
283+ allowEscape : false ,
284+ } ,
285+ ] ,
286+
281287 docs : {
282288 description :
283289 "Disallow characters which are made with multiple code points in character class syntax" ,
@@ -293,7 +299,6 @@ module.exports = {
293299 properties : {
294300 allowEscape : {
295301 type : "boolean" ,
296- default : false ,
297302 } ,
298303 } ,
299304 additionalProperties : false ,
@@ -313,7 +318,7 @@ module.exports = {
313318 } ,
314319 } ,
315320 create ( context ) {
316- const allowEscape = context . options [ 0 ] ?. allowEscape ;
321+ const [ { allowEscape } ] = context . options ;
317322 const sourceCode = context . sourceCode ;
318323 const parser = new RegExpParser ( ) ;
319324 const checkedPatternNodes = new Set ( ) ;
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ module.exports = {
4747 meta : {
4848 type : "suggestion" ,
4949
50+ defaultOptions : [ { } ] ,
51+
5052 docs : {
5153 description :
5254 "Enforce the use of `u` or `v` flag on regular expressions" ,
@@ -79,7 +81,7 @@ module.exports = {
7981 create ( context ) {
8082 const sourceCode = context . sourceCode ;
8183
82- const { requireFlag } = context . options [ 0 ] ?? { } ;
84+ const [ { requireFlag } ] = context . options ;
8385
8486 return {
8587 "Literal[regex]" ( node ) {
You can’t perform that action at this time.
0 commit comments