File tree 7 files changed +28
-28
lines changed
7 files changed +28
-28
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ module.exports = {
35
35
36
36
create ( context ) {
37
37
const sourceCode = context . getSourceCode ( ) ;
38
- const info = getRuleInfo ( sourceCode ) ;
39
- if ( ! info ) {
38
+ const ruleInfo = getRuleInfo ( sourceCode ) ;
39
+ if ( ! ruleInfo ) {
40
40
return { } ;
41
41
}
42
42
@@ -53,11 +53,11 @@ module.exports = {
53
53
54
54
return {
55
55
Program ( ) {
56
- if ( ! info . meta || info . meta . properties . length < 2 ) {
56
+ if ( ! ruleInfo . meta || ruleInfo . meta . properties . length < 2 ) {
57
57
return ;
58
58
}
59
59
60
- const props = info . meta . properties ;
60
+ const props = ruleInfo . meta . properties ;
61
61
62
62
let last ;
63
63
Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ module.exports = {
26
26
create ( context ) {
27
27
const sourceCode = context . getSourceCode ( ) ;
28
28
const { scopeManager } = sourceCode ;
29
- const info = utils . getRuleInfo ( sourceCode ) ;
30
- if ( ! info ) {
29
+ const ruleInfo = utils . getRuleInfo ( sourceCode ) ;
30
+ if ( ! ruleInfo ) {
31
31
return { } ;
32
32
}
33
33
@@ -36,7 +36,7 @@ module.exports = {
36
36
let hasSeenUnknownMessageId = false ;
37
37
let hasSeenViolationReport = false ;
38
38
39
- const messageIdNodes = utils . getMessageIdNodes ( info , scopeManager ) ;
39
+ const messageIdNodes = utils . getMessageIdNodes ( ruleInfo , scopeManager ) ;
40
40
if ( ! messageIdNodes ) {
41
41
// If we can't find `meta.messages`, disable the rule.
42
42
return { } ;
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ module.exports = {
29
29
30
30
create ( context ) {
31
31
const sourceCode = context . getSourceCode ( ) ;
32
- const info = utils . getRuleInfo ( sourceCode ) ;
33
- if ( ! info ) {
32
+ const ruleInfo = utils . getRuleInfo ( sourceCode ) ;
33
+ if ( ! ruleInfo ) {
34
34
return { } ;
35
35
}
36
36
@@ -47,7 +47,7 @@ module.exports = {
47
47
ast
48
48
) ;
49
49
50
- const metaNode = info . meta ;
50
+ const metaNode = ruleInfo . meta ;
51
51
const messagesNode =
52
52
metaNode &&
53
53
metaNode . properties &&
@@ -57,7 +57,7 @@ module.exports = {
57
57
58
58
if ( ! messagesNode ) {
59
59
context . report ( {
60
- node : metaNode || info . create ,
60
+ node : metaNode || ruleInfo . create ,
61
61
messageId : 'messagesMissing' ,
62
62
} ) ;
63
63
return ;
Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ module.exports = {
43
43
44
44
create ( context ) {
45
45
const sourceCode = context . getSourceCode ( ) ;
46
- const info = utils . getRuleInfo ( sourceCode ) ;
47
- if ( ! info ) {
46
+ const ruleInfo = utils . getRuleInfo ( sourceCode ) ;
47
+ if ( ! ruleInfo ) {
48
48
return { } ;
49
49
}
50
50
@@ -57,7 +57,7 @@ module.exports = {
57
57
? new RegExp ( context . options [ 0 ] . pattern )
58
58
: DEFAULT_PATTERN ;
59
59
60
- const metaNode = info . meta ;
60
+ const metaNode = ruleInfo . meta ;
61
61
const docsNode = utils
62
62
. evaluateObjectProperties ( metaNode , scopeManager )
63
63
. find ( ( p ) => p . type === 'Property' && utils . getKeyName ( p ) === 'docs' ) ;
@@ -71,7 +71,7 @@ module.exports = {
71
71
72
72
if ( ! descriptionNode ) {
73
73
context . report ( {
74
- node : docsNode || metaNode || info . create ,
74
+ node : docsNode || metaNode || ruleInfo . create ,
75
75
messageId : 'missing' ,
76
76
} ) ;
77
77
return ;
Original file line number Diff line number Diff line change @@ -73,16 +73,16 @@ module.exports = {
73
73
}
74
74
75
75
const sourceCode = context . getSourceCode ( ) ;
76
- const info = util . getRuleInfo ( sourceCode ) ;
77
- if ( ! info ) {
76
+ const ruleInfo = util . getRuleInfo ( sourceCode ) ;
77
+ if ( ! ruleInfo ) {
78
78
return { } ;
79
79
}
80
80
81
81
return {
82
82
Program ( ) {
83
83
const { scopeManager } = sourceCode ;
84
84
85
- const metaNode = info . meta ;
85
+ const metaNode = ruleInfo . meta ;
86
86
const docsPropNode = util
87
87
. evaluateObjectProperties ( metaNode , scopeManager )
88
88
. find ( ( p ) => p . type === 'Property' && util . getKeyName ( p ) === 'docs' ) ;
@@ -110,7 +110,7 @@ module.exports = {
110
110
( urlPropNode && urlPropNode . value ) ||
111
111
( docsPropNode && docsPropNode . value ) ||
112
112
metaNode ||
113
- info . create ,
113
+ ruleInfo . create ,
114
114
115
115
messageId : ! urlPropNode
116
116
? 'missing'
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ module.exports = {
43
43
create ( context ) {
44
44
const sourceCode = context . getSourceCode ( ) ;
45
45
const { scopeManager } = sourceCode ;
46
- const info = utils . getRuleInfo ( sourceCode ) ;
47
- if ( ! info ) {
46
+ const ruleInfo = utils . getRuleInfo ( sourceCode ) ;
47
+ if ( ! ruleInfo ) {
48
48
return { } ;
49
49
}
50
50
51
51
let contextIdentifiers ;
52
- const metaNode = info . meta ;
52
+ const metaNode = ruleInfo . meta ;
53
53
let schemaNode ;
54
54
55
55
// Options
@@ -115,7 +115,7 @@ module.exports = {
115
115
'Program:exit' ( ) {
116
116
if ( ! schemaNode && requireSchemaPropertyWhenOptionless ) {
117
117
context . report ( {
118
- node : metaNode || info . create ,
118
+ node : metaNode || ruleInfo . create ,
119
119
messageId : 'missing' ,
120
120
suggest :
121
121
! isUsingOptions &&
@@ -150,7 +150,7 @@ module.exports = {
150
150
) {
151
151
isUsingOptions = true ;
152
152
context . report ( {
153
- node : schemaNode || metaNode || info . create ,
153
+ node : schemaNode || metaNode || ruleInfo . create ,
154
154
messageId : 'foundOptionsUsage' ,
155
155
} ) ;
156
156
}
Original file line number Diff line number Diff line change @@ -39,23 +39,23 @@ module.exports = {
39
39
// ----------------------------------------------------------------------
40
40
41
41
const sourceCode = context . getSourceCode ( ) ;
42
- const info = utils . getRuleInfo ( sourceCode ) ;
43
- if ( ! info ) {
42
+ const ruleInfo = utils . getRuleInfo ( sourceCode ) ;
43
+ if ( ! ruleInfo ) {
44
44
return { } ;
45
45
}
46
46
47
47
return {
48
48
Program ( ) {
49
49
const { scopeManager } = sourceCode ;
50
50
51
- const metaNode = info . meta ;
51
+ const metaNode = ruleInfo . meta ;
52
52
const typeNode = utils
53
53
. evaluateObjectProperties ( metaNode , scopeManager )
54
54
. find ( ( p ) => p . type === 'Property' && utils . getKeyName ( p ) === 'type' ) ;
55
55
56
56
if ( ! typeNode ) {
57
57
context . report ( {
58
- node : metaNode || info . create ,
58
+ node : metaNode || ruleInfo . create ,
59
59
messageId : 'missing' ,
60
60
} ) ;
61
61
return ;
You can’t perform that action at this time.
0 commit comments