You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am able to use the full range of AST selectors with no-missing-syntax; I would expect no-restricted-syntax to have parity, regardless of which other contexts are used
Actual behavior
error Syntax is restricted: undefined jsdoc/no-restricted-syntax
Note that the configured message is also not used
ESLint Config
parser is @typescript-eslint/parser, this is the only rule needed:
"jsdoc/no-restricted-syntax": ["error",{"contexts": [{"context": "any","comment": "JsdocBlock[postDelimiter='']:has(JsdocTag ~ JsdocTag[tag=/private|protected/])","message": "Access modifier tags must come first"},{"context": ":declaration:not(TSEnumDeclaration):not(:has(ObjectExpression)), :function","comment": "JsdocBlock[postDelimiter='']:has(JsdocTag[tag='enum'])","message": "@enum is only allowed on potential enum types"},]}]
If the other rule is deleted or the context is changed to something else (excluding *), the context is interpreted correctly
ESLint sample
/** * @enum {String} * Object holding values of some custom enum */constMY_ENUM=Object.freeze({VAL_A: "myvala"}asconst);
Environment
Node version: 16.13.1
ESLint version 8.4.1
eslint-plugin-jsdoc version: 37.2.2
The text was updated successfully, but these errors were encountered:
budjmt
changed the title
jsdoc/no-restricted-syntax: context does not support full range of selectors if any other context is any/*jsdoc/no-restricted-syntax: context does not support full range of selectors if any other context is any/*Dec 17, 2021
Thank you for the report. Turns out we had two problems. One was that there was indeed a specific issue with no-restricted-syntax that could cause it to report just because there was a context match (without a comment match). Another more serious issue was that if one reused the same context, the old value would be overwritten. Both of these issues should now be fixed.
However, I think there may be still one issue remaining (I believe with no-restricted-syntax alone); namely, if there is an "any" context, only handling for such a context occurs.
Expected behavior
I am able to use the full range of AST selectors with
no-missing-syntax
; I would expectno-restricted-syntax
to have parity, regardless of which other contexts are usedActual behavior
error Syntax is restricted: undefined jsdoc/no-restricted-syntax
Note that the configured message is also not used
ESLint Config
parser is
@typescript-eslint/parser
, this is the only rule needed:If the other rule is deleted or the context is changed to something else (excluding
*
), the context is interpreted correctlyESLint sample
Environment
eslint-plugin-jsdoc
version: 37.2.2The text was updated successfully, but these errors were encountered: