|
1 |
- {"version":3,"sources":["../../src/rules/requireProperty.js"],"names":["utils","propertyAssociatedTags","filterTags","tag","includes","length","targetTagName","getPreferredTagName","tagName","hasATag","forEach","propertyAssociatedTag","type","reportJSDoc","addTag","iterateAllJsdocs","meta","docs","description","url","fixable"],"mappings":";;;;;;;AAAA;;;;eAEe,2BAAa,CAAC;AAC3BA,EAAAA;AAD2B,CAAD,KAEtB;AACJ,QAAMC,sBAAsB,GAAGD,KAAK,CAACE,UAAN,CAAiB,CAAC;AAACC,IAAAA;AAAD,GAAD,KAAW;AACzD,WAAO,CAAC,SAAD,EAAY,WAAZ,EAAyBC,QAAzB,CAAkCD,GAAlC,CAAP;AACD,GAF8B,CAA/B;;AAGA,MAAI,CAACF,sBAAsB,CAACI,MAA5B,EAAoC;AAClC;AACD;;AACD,QAAMC,aAAa,GAAGN,KAAK,CAACO,mBAAN,CAA0B;AAACC,IAAAA,OAAO,EAAE;AAAV,GAA1B,CAAtB;;AAEA,MAAIR,KAAK,CAACS,OAAN,CAAc,CAACH,aAAD,CAAd,CAAJ,EAAoC;AAClC;AACD;;AAEDL,EAAAA,sBAAsB,CAACS,OAAvB,CAAgCC,qBAAD,IAA2B;AACxD,QAAI,CAAC,CAAC,QAAD,EAAW,QAAX,EAAqB,aAArB,EAAoCP,QAApC,CAA6CO,qBAAqB,CAACC,IAAnE,CAAL,EAA+E;AAC7E;AACD;;AACDZ,IAAAA,KAAK,CAACa,WAAN,CAAmB,kBAAiBP,aAAc,GAAlD,EAAsD,IAAtD,EAA4D,MAAM;AAChEN,MAAAA,KAAK,CAACc,MAAN,CAAaR,aAAb;AACD,KAFD;AAGD,GAPD;AAQD,CAvBc,EAuBZ;AACDS,EAAAA,gBAAgB,EAAE,IADjB;AAEDC,EAAAA,IAAI,EAAE;AACJC,IAAAA,IAAI,EAAE;AACJC,MAAAA,WAAW,EAAE,sIADT;AAEJC,MAAAA,GAAG,EAAE;AAFD,KADF;AAKJC,IAAAA,OAAO,EAAE,MALL;AAMJR,IAAAA,IAAI,EAAE;AANF;AAFL,CAvBY,C","sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n utils,\n}) => {\n const propertyAssociatedTags = utils.filterTags(({tag}) => {\n return ['typedef', 'namespace'].includes(tag);\n });\n if (!propertyAssociatedTags.length) {\n return;\n }\n const targetTagName = utils.getPreferredTagName({tagName: 'property'});\n\n if (utils.hasATag([targetTagName])) {\n return;\n }\n\n propertyAssociatedTags.forEach((propertyAssociatedTag) => {\n if (!['object', 'Object', 'PlainObject'].includes(propertyAssociatedTag.type)) {\n return;\n }\n utils.reportJSDoc(`Missing JSDoc @${targetTagName}.`, null, () => {\n utils.addTag(targetTagName);\n });\n });\n}, {\n iterateAllJsdocs: true,\n meta: {\n docs: {\n description: 'Requires that all `@typedef` and `@namespace` tags have `@property` when their type is a plain `object`, `Object`, or `PlainObject`.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-property',\n },\n fixable: 'code',\n type: 'suggestion',\n },\n});\n"],"file":"requireProperty.js"}
|