|
1 |
- {"version":3,"sources":["../../src/rules/noRestrictedSyntax.js"],"names":["context","info","selector","comment","report","options","length","contexts","foundContext","find","cntxt","contextStr","message","contextSelected","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","anyOf","type","required"],"mappings":";;;;;;;AAAA;;;;eAEe,2BAAa,CAAC;AAC3BA,EAAAA,OAD2B;AAE3BC,EAAAA,IAAI,EAAE;AAACC,IAAAA,QAAD;AAAWC,IAAAA;AAAX,GAFqB;AAG3BC,EAAAA;AAH2B,CAAD,KAItB;AAAA;;AACJ,MAAI,CAACJ,OAAO,CAACK,OAAR,CAAgBC,MAArB,EAA6B;AAC3BF,IAAAA,MAAM,CAAC,4DAAD,CAAN;AAEA;AACD;;AACD,QAAM;AAACG,IAAAA;AAAD,MAAaP,OAAO,CAACK,OAAR,CAAgB,CAAhB,CAAnB;AAEA,QAAMG,YAAY,GAAGD,QAAQ,CAACE,IAAT,CAAeC,KAAD,IAAW;AAC5C,WAAOA,KAAK,KAAKR,QAAV,IACL,OAAOQ,KAAP,KAAiB,QAAjB,KACC,CAACA,KAAK,CAACV,OAAP,IAAkBU,KAAK,CAACV,OAAN,KAAkB,KAApC,IAA6CE,QAAQ,KAAKQ,KAAK,CAACV,OADjE,KAEEG,OAAO,KAAKO,KAAK,CAACP,OAHtB;AAID,GALoB,CAArB;AAOA,QAAMQ,UAAU,GAAG,OAAOH,YAAP,KAAwB,QAAxB,4BACjBA,YAAY,CAACR,OADI,yEACO,KADP,GAEjBQ,YAFF;AAGA,QAAMI,OAAO,4BAAGJ,YAAH,aAAGA,YAAH,uBAAGA,YAAY,CAAEI,OAAjB,yEACX,oCADF;AAGAR,EAAAA,MAAM,CAACQ,OAAD,EAAU,IAAV,EAAgB,IAAhB,EAAsB;AAC1BZ,IAAAA,OAAO,EAAEW;AADiB,GAAtB,CAAN;AAGD,CA5Bc,EA4BZ;AACDE,EAAAA,eAAe,EAAE,IADhB;AAEDC,EAAAA,IAAI,EAAE;AACJC,IAAAA,IAAI,EAAE;AACJC,MAAAA,WAAW,EAAE,sDADT;AAEJC,MAAAA,GAAG,EAAE;AAFD,KADF;AAKJC,IAAAA,OAAO,EAAE,MALL;AAMJC,IAAAA,MAAM,EAAE,CACN;AACEC,MAAAA,oBAAoB,EAAE,KADxB;AAEEC,MAAAA,UAAU,EAAE;AACVd,QAAAA,QAAQ,EAAE;AACRe,UAAAA,KAAK,EAAE;AACLC,YAAAA,KAAK,EAAE,CACL;AACEC,cAAAA,IAAI,EAAE;AADR,aADK,EAIL;AACEJ,cAAAA,oBAAoB,EAAE,KADxB;AAEEC,cAAAA,UAAU,EAAE;AACVlB,gBAAAA,OAAO,EAAE;AACPqB,kBAAAA,IAAI,EAAE;AADC,iBADC;AAIVxB,gBAAAA,OAAO,EAAE;AACPwB,kBAAAA,IAAI,EAAE;AADC,iBAJC;AAOVZ,gBAAAA,OAAO,EAAE;AACPY,kBAAAA,IAAI,EAAE;AADC;AAPC,eAFd;AAaEA,cAAAA,IAAI,EAAE;AAbR,aAJK;AADF,WADC;AAuBRA,UAAAA,IAAI,EAAE;AAvBE;AADA,OAFd;AA6BEC,MAAAA,QAAQ,EAAE,CAAC,UAAD,CA7BZ;AA8BED,MAAAA,IAAI,EAAE;AA9BR,KADM,CANJ;AAwCJA,IAAAA,IAAI,EAAE;AAxCF;AAFL,CA5BY,C","sourcesContent":["import iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n context,\n info: {selector, comment},\n report,\n}) => {\n if (!context.options.length) {\n report('Rule `no-restricted-syntax` is missing a `context` option.');\n\n return;\n }\n const {contexts} = context.options[0];\n\n const foundContext = contexts.find((cntxt) => {\n return cntxt === selector ||\n typeof cntxt === 'object' &&\n (!cntxt.context || cntxt.context === 'any' || selector === cntxt.context) &&\n comment === cntxt.comment;\n });\n\n const contextStr = typeof foundContext === 'object' ?\n foundContext.context ?? 'any' :\n foundContext;\n const message = foundContext?.message ??\n 'Syntax is restricted: {{context}}.';\n\n report(message, null, null, {\n context: contextStr,\n });\n}, {\n contextSelected: true,\n meta: {\n docs: {\n description: 'Reports when certain comment structures are present.',\n url: 'https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-restricted-syntax',\n },\n fixable: 'code',\n schema: [\n {\n additionalProperties: false,\n properties: {\n contexts: {\n items: {\n anyOf: [\n {\n type: 'string',\n },\n {\n additionalProperties: false,\n properties: {\n comment: {\n type: 'string',\n },\n context: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n },\n type: 'object',\n },\n ],\n },\n type: 'array',\n },\n },\n required: ['contexts'],\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"file":"noRestrictedSyntax.js"}
|