66
77const utils = require ( '../utils' )
88
9+ /**
10+ * @typedef {import('../utils').ComponentProp } ComponentProp
11+ */
12+
913const PROPS_SEPARATOR = ', '
1014
1115/**
@@ -53,8 +57,11 @@ function* fixTypeBased(fixer, node, props, context) {
5357 }
5458 return null
5559}
56- const mapNativeType = ( /** @type {string } */ nativeType ) => {
57- switch ( nativeType ) {
60+ /**
61+ * @param {string } nativeType
62+ * @returns {string }
63+ */
64+ const mapNativeType = ( nativeType ) => { switch ( nativeType ) {
5865 case 'String' : {
5966 return 'string'
6067 }
@@ -125,7 +132,6 @@ function optionGetType(node, sourceCode) {
125132 case 'ArrayExpression' : {
126133 return node . elements
127134 . map ( ( element ) => {
128- // TODO handle SpreadElement
129135 if ( element === null || element . type === 'SpreadElement' ) {
130136 return sourceCode . getText ( node )
131137 }
@@ -175,7 +181,7 @@ function optionGetType(node, sourceCode) {
175181
176182/**
177183 * @param {Expression } node
178- * @returns {boolean | undefined }
184+ * @returns {boolean }
179185 */
180186function optionGetRequired ( node ) {
181187 if ( node . type === 'ObjectExpression' ) {
@@ -195,7 +201,7 @@ function optionGetRequired(node) {
195201
196202/**
197203 * @param {Expression } node
198- * @returns {Expression | undefined }
204+ * @returns {Expression | undefined }
199205 */
200206function optionGetDefault ( node ) {
201207 if ( node . type === 'ObjectExpression' ) {
@@ -211,10 +217,6 @@ function optionGetDefault(node) {
211217 return undefined
212218}
213219
214- /**
215- * @typedef {import('../utils').ComponentProp } ComponentProp
216- */
217-
218220module . exports = {
219221 meta : {
220222 type : 'suggestion' ,
0 commit comments