@@ -50,17 +50,6 @@ function hasMetaDocs(metaPropertyNode) {
50
50
return Boolean ( getPropertyFromObject ( "docs" , metaPropertyNode . value ) ) ;
51
51
}
52
52
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
-
64
53
/**
65
54
* Whether this `meta` ObjectExpression has a `docs.category` property defined or not.
66
55
* @param {ASTNode } metaPropertyNode The `meta` ObjectExpression for this rule.
@@ -83,15 +72,6 @@ function hasMetaDocsRecommended(metaPropertyNode) {
83
72
return metaDocs && getPropertyFromObject ( "recommended" , metaDocs . value ) ;
84
73
}
85
74
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
-
95
75
/**
96
76
* Checks the validity of the meta definition of this rule and reports any errors found.
97
77
* @param {RuleContext } context The ESLint rule context.
@@ -111,35 +91,16 @@ function checkMetaValidity(context, exportsNode) {
111
91
return ;
112
92
}
113
93
114
- if ( ! hasMetaDocsDescription ( metaProperty ) ) {
115
- context . report ( { node : metaProperty , messageId : "missingMetaDocsDescription" } ) ;
116
- return ;
117
- }
118
-
119
94
if ( ! hasMetaDocsCategory ( metaProperty ) ) {
120
95
context . report ( { node : metaProperty , messageId : "missingMetaDocsCategory" } ) ;
121
96
return ;
122
97
}
123
98
124
99
if ( ! hasMetaDocsRecommended ( metaProperty ) ) {
125
100
context . report ( { node : metaProperty , messageId : "missingMetaDocsRecommended" } ) ;
126
- return ;
127
- }
128
-
129
- if ( ! hasMetaSchema ( metaProperty ) ) {
130
- context . report ( { node : metaProperty , messageId : "missingMetaSchema" } ) ;
131
101
}
132
102
}
133
103
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
-
143
104
//------------------------------------------------------------------------------
144
105
// Rule Definition
145
106
//------------------------------------------------------------------------------
@@ -156,12 +117,9 @@ module.exports = {
156
117
messages : {
157
118
missingMeta : "Rule is missing a meta property." ,
158
119
missingMetaDocs : "Rule is missing a meta.docs property." ,
159
- missingMetaDocsDescription : "Rule is missing a meta.docs.description property." ,
160
120
missingMetaDocsCategory : "Rule is missing a meta.docs.category property." ,
161
121
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."
165
123
}
166
124
} ,
167
125
@@ -186,11 +144,6 @@ module.exports = {
186
144
node,
187
145
messageId : "noExport"
188
146
} ) ;
189
- } else if ( ! isCorrectExportsFormat ( exportsNode ) ) {
190
- context . report ( {
191
- node : exportsNode ,
192
- messageId : "incorrectExport"
193
- } ) ;
194
147
} else {
195
148
checkMetaValidity ( context , exportsNode ) ;
196
149
}
0 commit comments