@@ -50,17 +50,6 @@ function hasMetaDocs(metaPropertyNode) {
5050 return Boolean ( getPropertyFromObject ( "docs" , metaPropertyNode . value ) ) ;
5151}
5252
53- /**
54- * Whether this `meta` ObjectExpression has a `docs.description` property defined or not.
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-
6453/**
6554 * Whether this `meta` ObjectExpression has a `docs.category` property defined or not.
6655 * @param {ASTNode } metaPropertyNode The `meta` ObjectExpression for this rule.
@@ -83,15 +72,6 @@ function hasMetaDocsRecommended(metaPropertyNode) {
8372 return metaDocs && getPropertyFromObject ( "recommended" , metaDocs . value ) ;
8473}
8574
86- /**
87- * Whether this `meta` ObjectExpression has a `schema` property defined or not.
88- * @param {ASTNode } metaPropertyNode The `meta` ObjectExpression for this rule.
89- * @returns {boolean } `true` if a `schema` property exists.
90- */
91- function hasMetaSchema ( metaPropertyNode ) {
92- return getPropertyFromObject ( "schema" , metaPropertyNode . value ) ;
93- }
94-
9575/**
9676 * Checks the validity of the meta definition of this rule and reports any errors found.
9777 * @param {RuleContext } context The ESLint rule context.
@@ -111,35 +91,16 @@ function checkMetaValidity(context, exportsNode) {
11191 return ;
11292 }
11393
114- if ( ! hasMetaDocsDescription ( metaProperty ) ) {
115- context . report ( { node : metaProperty , messageId : "missingMetaDocsDescription" } ) ;
116- return ;
117- }
118-
11994 if ( ! hasMetaDocsCategory ( metaProperty ) ) {
12095 context . report ( { node : metaProperty , messageId : "missingMetaDocsCategory" } ) ;
12196 return ;
12297 }
12398
12499 if ( ! hasMetaDocsRecommended ( metaProperty ) ) {
125100 context . report ( { node : metaProperty , messageId : "missingMetaDocsRecommended" } ) ;
126- return ;
127- }
128-
129- if ( ! hasMetaSchema ( metaProperty ) ) {
130- context . report ( { node : metaProperty , messageId : "missingMetaSchema" } ) ;
131101 }
132102}
133103
134- /**
135- * Whether this node is the correct format for a rule definition or not.
136- * @param {ASTNode } node node that the rule exports.
137- * @returns {boolean } `true` if the exported node is the correct format for a rule definition
138- */
139- function isCorrectExportsFormat ( node ) {
140- return node . type === "ObjectExpression" ;
141- }
142-
143104//------------------------------------------------------------------------------
144105// Rule Definition
145106//------------------------------------------------------------------------------
@@ -156,12 +117,9 @@ module.exports = {
156117 messages : {
157118 missingMeta : "Rule is missing a meta property." ,
158119 missingMetaDocs : "Rule is missing a meta.docs property." ,
159- missingMetaDocsDescription : "Rule is missing a meta.docs.description property." ,
160120 missingMetaDocsCategory : "Rule is missing a meta.docs.category property." ,
161121 missingMetaDocsRecommended : "Rule is missing a meta.docs.recommended property." ,
162- missingMetaSchema : "Rule is missing a meta.schema property." ,
163- noExport : "Rule does not export anything. Make sure rule exports an object according to new rule format." ,
164- incorrectExport : "Rule does not export an Object. Make sure the rule follows the new rule format."
122+ noExport : "Rule does not export anything. Make sure rule exports an object according to new rule format."
165123 }
166124 } ,
167125
@@ -186,11 +144,6 @@ module.exports = {
186144 node,
187145 messageId : "noExport"
188146 } ) ;
189- } else if ( ! isCorrectExportsFormat ( exportsNode ) ) {
190- context . report ( {
191- node : exportsNode ,
192- messageId : "incorrectExport"
193- } ) ;
194147 } else {
195148 checkMetaValidity ( context , exportsNode ) ;
196149 }
0 commit comments