-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
Expected behavior
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
*/
const MY_ENUM = Object.freeze({
VAL_A: "myvala"
} as const);Environment
- Node version: 16.13.1
- ESLint version 8.4.1
eslint-plugin-jsdocversion: 37.2.2