@@ -49,18 +49,6 @@ function hasMetaDocs(metaPropertyNode) {
49
49
return Boolean ( getPropertyFromObject ( 'docs' , metaPropertyNode . value ) )
50
50
}
51
51
52
- /**
53
- * Whether this `meta` ObjectExpression has a `docs.description` property defined or not.
54
- *
55
- * @param {ASTNode } metaPropertyNode The `meta` ObjectExpression for this rule.
56
- * @returns {boolean } `true` if a `docs.description` property exists.
57
- */
58
- function hasMetaDocsDescription ( metaPropertyNode ) {
59
- const metaDocs = getPropertyFromObject ( 'docs' , metaPropertyNode . value )
60
-
61
- return metaDocs && getPropertyFromObject ( 'description' , metaDocs . value )
62
- }
63
-
64
52
/**
65
53
* Whether this `meta` ObjectExpression has a `docs.category` property defined or not.
66
54
*
@@ -73,16 +61,6 @@ function hasMetaDocsCategories(metaPropertyNode) {
73
61
return metaDocs && getPropertyFromObject ( 'categories' , metaDocs . value )
74
62
}
75
63
76
- /**
77
- * Whether this `meta` ObjectExpression has a `schema` property defined or not.
78
- *
79
- * @param {ASTNode } metaPropertyNode The `meta` ObjectExpression for this rule.
80
- * @returns {boolean } `true` if a `schema` property exists.
81
- */
82
- function hasMetaSchema ( metaPropertyNode ) {
83
- return getPropertyFromObject ( 'schema' , metaPropertyNode . value )
84
- }
85
-
86
64
/**
87
65
* Checks the validity of the meta definition of this rule and reports any errors found.
88
66
*
@@ -104,35 +82,13 @@ function checkMetaValidity(context, exportsNode) {
104
82
return
105
83
}
106
84
107
- if ( ! hasMetaDocsDescription ( metaProperty ) ) {
108
- context . report (
109
- metaProperty ,
110
- 'Rule is missing a meta.docs.description property.'
111
- )
112
- return
113
- }
114
-
115
85
if ( ! hasMetaDocsCategories ( metaProperty ) ) {
116
86
context . report (
117
87
metaProperty ,
118
88
'Rule is missing a meta.docs.categories property.'
119
89
)
120
90
return
121
91
}
122
-
123
- if ( ! hasMetaSchema ( metaProperty ) ) {
124
- context . report ( metaProperty , 'Rule is missing a meta.schema property.' )
125
- }
126
- }
127
-
128
- /**
129
- * Whether this node is the correct format for a rule definition or not.
130
- *
131
- * @param {ASTNode } node node that the rule exports.
132
- * @returns {boolean } `true` if the exported node is the correct format for a rule definition
133
- */
134
- function isCorrectExportsFormat ( node ) {
135
- return node != null && node . type === 'ObjectExpression'
136
92
}
137
93
138
94
// ------------------------------------------------------------------------------
@@ -166,15 +122,6 @@ module.exports = {
166
122
} ,
167
123
168
124
'Program:exit' ( programNode ) {
169
- if ( ! isCorrectExportsFormat ( exportsNode ) ) {
170
- context . report ( {
171
- node : exportsNode || programNode ,
172
- message :
173
- 'Rule does not export an Object. Make sure the rule follows the new rule format.'
174
- } )
175
- return
176
- }
177
-
178
125
checkMetaValidity ( context , exportsNode )
179
126
}
180
127
}
0 commit comments