eslint-plugin-jsdoc 38.1.4 → 38.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9328,7 +9328,7 @@ function quux () {
9328
9328
 
9329
9329
  }
9330
9330
  // "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":["FunctionDeclaration"]}]
9331
- // Message: Syntax is restricted: FunctionDeclaration.
9331
+ // Message: Syntax is restricted: FunctionDeclaration
9332
9332
 
9333
9333
  /**
9334
9334
  *
@@ -9346,7 +9346,7 @@ function quux () {
9346
9346
 
9347
9347
  }
9348
9348
  // "jsdoc/no-restricted-syntax": ["error"|"warn", {"contexts":[{"comment":"JsdocBlock[postDelimiter=\"\"]:has(JsdocTypeUnion > JsdocTypeName[value=\"Bar\"]:nth-child(1))","context":"FunctionDeclaration"}]}]
9349
- // Message: Syntax is restricted: FunctionDeclaration.
9349
+ // Message: Syntax is restricted: FunctionDeclaration with JsdocBlock[postDelimiter=""]:has(JsdocTypeUnion > JsdocTypeName[value="Bar"]:nth-child(1))
9350
9350
 
9351
9351
  /**
9352
9352
  * @implements {Bar|Foo}
@@ -39,8 +39,9 @@ var _default = (0, _iterateJsdoc.default)(({
39
39
  }
40
40
 
41
41
  const contextStr = typeof foundContext === 'object' ? (_foundContext$context = foundContext.context) !== null && _foundContext$context !== void 0 ? _foundContext$context : 'any' : foundContext;
42
- const message = (_foundContext$message = foundContext === null || foundContext === void 0 ? void 0 : foundContext.message) !== null && _foundContext$message !== void 0 ? _foundContext$message : 'Syntax is restricted: {{context}}.';
42
+ const message = (_foundContext$message = foundContext === null || foundContext === void 0 ? void 0 : foundContext.message) !== null && _foundContext$message !== void 0 ? _foundContext$message : 'Syntax is restricted: {{context}}' + (comment ? ' with {{comment}}' : '');
43
43
  report(message, null, null, {
44
+ comment,
44
45
  context: contextStr
45
46
  });
46
47
  }, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/rules/noRestrictedSyntax.js"],"names":["node","context","info","comment","report","options","length","contexts","foundContext","find","cntxt","esquery","matches","parse","contextStr","message","contextSelected","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","anyOf","type","required"],"mappings":";;;;;;;AAAA;;AACA;;;;eAEe,2BAAa,CAAC;AAC3BA,EAAAA,IAD2B;AAE3BC,EAAAA,OAF2B;AAG3BC,EAAAA,IAAI,EAAE;AACJC,IAAAA;AADI,GAHqB;AAM3BC,EAAAA;AAN2B,CAAD,KAOtB;AAAA;;AACJ,MAAI,CAACH,OAAO,CAACI,OAAR,CAAgBC,MAArB,EAA6B;AAC3BF,IAAAA,MAAM,CAAC,4DAAD,CAAN;AAEA;AACD;;AAED,QAAM;AACJG,IAAAA;AADI,MAEFN,OAAO,CAACI,OAAR,CAAgB,CAAhB,CAFJ;AAIA,QAAMG,YAAY,GAAGD,QAAQ,CAACE,IAAT,CAAeC,KAAD,IAAW;AAC5C,WAAO,OAAOA,KAAP,KAAiB,QAAjB,GACLC,iBAAQC,OAAR,CAAgBZ,IAAhB,EAAsBW,iBAAQE,KAAR,CAAcH,KAAd,CAAtB,CADK,GAEL,CAAC,CAACA,KAAK,CAACT,OAAP,IAAkBS,KAAK,CAACT,OAAN,KAAkB,KAApC,IAA6CU,iBAAQC,OAAR,CAAgBZ,IAAhB,EAAsBW,iBAAQE,KAAR,CAAcH,KAAK,CAACT,OAApB,CAAtB,CAA9C,KACEE,OAAO,KAAKO,KAAK,CAACP,OAHtB;AAID,GALoB,CAArB,CAXI,CAkBJ;AACA;;AACA,MAAI,CAACK,YAAL,EAAmB;AACjB;AACD;;AAED,QAAMM,UAAU,GAAG,OAAON,YAAP,KAAwB,QAAxB,4BACjBA,YAAY,CAACP,OADI,yEACO,KADP,GAEjBO,YAFF;AAGA,QAAMO,OAAO,4BAAGP,YAAH,aAAGA,YAAH,uBAAGA,YAAY,CAAEO,OAAjB,yEACX,oCADF;AAGAX,EAAAA,MAAM,CAACW,OAAD,EAAU,IAAV,EAAgB,IAAhB,EAAsB;AAC1Bd,IAAAA,OAAO,EAAEa;AADiB,GAAtB,CAAN;AAGD,CAxCc,EAwCZ;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;AACVjB,QAAAA,QAAQ,EAAE;AACRkB,UAAAA,KAAK,EAAE;AACLC,YAAAA,KAAK,EAAE,CACL;AACEC,cAAAA,IAAI,EAAE;AADR,aADK,EAIL;AACEJ,cAAAA,oBAAoB,EAAE,KADxB;AAEEC,cAAAA,UAAU,EAAE;AACVrB,gBAAAA,OAAO,EAAE;AACPwB,kBAAAA,IAAI,EAAE;AADC,iBADC;AAIV1B,gBAAAA,OAAO,EAAE;AACP0B,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,CACR,UADQ,CA7BZ;AAgCED,MAAAA,IAAI,EAAE;AAhCR,KADM,CANJ;AA0CJA,IAAAA,IAAI,EAAE;AA1CF;AAFL,CAxCY,C","sourcesContent":["import esquery from 'esquery';\nimport iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n node,\n context,\n info: {\n comment,\n },\n report,\n}) => {\n if (!context.options.length) {\n report('Rule `no-restricted-syntax` is missing a `context` option.');\n\n return;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n const foundContext = contexts.find((cntxt) => {\n return typeof cntxt === 'string' ?\n esquery.matches(node, esquery.parse(cntxt)) :\n (!cntxt.context || cntxt.context === 'any' || esquery.matches(node, esquery.parse(cntxt.context))) &&\n comment === cntxt.comment;\n });\n\n // We are not on the *particular* matching context/comment, so don't assume\n // we need reporting\n if (!foundContext) {\n return;\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: [\n 'contexts',\n ],\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"file":"noRestrictedSyntax.js"}
1
+ {"version":3,"sources":["../../src/rules/noRestrictedSyntax.js"],"names":["node","context","info","comment","report","options","length","contexts","foundContext","find","cntxt","esquery","matches","parse","contextStr","message","contextSelected","meta","docs","description","url","fixable","schema","additionalProperties","properties","items","anyOf","type","required"],"mappings":";;;;;;;AAAA;;AACA;;;;eAEe,2BAAa,CAAC;AAC3BA,EAAAA,IAD2B;AAE3BC,EAAAA,OAF2B;AAG3BC,EAAAA,IAAI,EAAE;AACJC,IAAAA;AADI,GAHqB;AAM3BC,EAAAA;AAN2B,CAAD,KAOtB;AAAA;;AACJ,MAAI,CAACH,OAAO,CAACI,OAAR,CAAgBC,MAArB,EAA6B;AAC3BF,IAAAA,MAAM,CAAC,4DAAD,CAAN;AAEA;AACD;;AAED,QAAM;AACJG,IAAAA;AADI,MAEFN,OAAO,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,EAAE;AACLC,YAAAA,KAAK,EAAE,CACL;AACEC,cAAAA,IAAI,EAAE;AADR,aADK,EAIL;AACEJ,cAAAA,oBAAoB,EAAE,KADxB;AAEEC,cAAAA,UAAU,EAAE;AACVrB,gBAAAA,OAAO,EAAE;AACPwB,kBAAAA,IAAI,EAAE;AADC,iBADC;AAIV1B,gBAAAA,OAAO,EAAE;AACP0B,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,CACR,UADQ,CA7BZ;AAgCED,MAAAA,IAAI,EAAE;AAhCR,KADM,CANJ;AA0CJA,IAAAA,IAAI,EAAE;AA1CF;AAFL,CA1CY,C","sourcesContent":["import esquery from 'esquery';\nimport iterateJsdoc from '../iterateJsdoc';\n\nexport default iterateJsdoc(({\n node,\n context,\n info: {\n comment,\n },\n report,\n}) => {\n if (!context.options.length) {\n report('Rule `no-restricted-syntax` is missing a `context` option.');\n\n return;\n }\n\n const {\n contexts,\n } = context.options[0];\n\n const foundContext = contexts.find((cntxt) => {\n return typeof cntxt === 'string' ?\n esquery.matches(node, esquery.parse(cntxt)) :\n (!cntxt.context || cntxt.context === 'any' || esquery.matches(node, esquery.parse(cntxt.context))) &&\n comment === cntxt.comment;\n });\n\n // We are not on the *particular* matching context/comment, so don't assume\n // we need reporting\n if (!foundContext) {\n return;\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 (comment ? ' with {{comment}}' : '');\n\n report(message, null, null, {\n comment,\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: [\n 'contexts',\n ],\n type: 'object',\n },\n ],\n type: 'suggestion',\n },\n});\n"],"file":"noRestrictedSyntax.js"}
package/package.json CHANGED
@@ -25,14 +25,14 @@
25
25
  "@babel/preset-env": "^7.16.11",
26
26
  "@babel/register": "^7.17.7",
27
27
  "@hkdobrev/run-if-changed": "^0.3.1",
28
- "@typescript-eslint/parser": "^5.15.0",
28
+ "@typescript-eslint/parser": "^5.17.0",
29
29
  "babel-plugin-add-module-exports": "^1.0.4",
30
30
  "babel-plugin-istanbul": "^6.1.1",
31
31
  "camelcase": "^6.3.0",
32
32
  "chai": "^4.3.6",
33
33
  "cross-env": "^7.0.3",
34
34
  "decamelize": "^5.0.1",
35
- "eslint": "^8.11.0",
35
+ "eslint": "^8.12.0",
36
36
  "eslint-config-canonical": "^33.0.1",
37
37
  "gitdown": "^3.1.5",
38
38
  "glob": "^7.2.0",
@@ -44,7 +44,7 @@
44
44
  "open-editor": "^3.0.0",
45
45
  "rimraf": "^3.0.2",
46
46
  "semantic-release": "^19.0.2",
47
- "typescript": "^4.6.2"
47
+ "typescript": "^4.6.3"
48
48
  },
49
49
  "engines": {
50
50
  "node": "^12 || ^14 || ^16 || ^17"
@@ -116,5 +116,5 @@
116
116
  "test-cov": "cross-env TIMING=1 nyc --reporter text npm run test-no-cov",
117
117
  "test-index": "npm run test-no-cov -- test/rules/index.js"
118
118
  },
119
- "version": "38.1.4"
119
+ "version": "38.1.5"
120
120
  }