Closed remcohaszing closed 1 year ago
I would suggest just using jsdoc/no-restricted-syntax
. This won't have a fixer, but it can report the non-desired configurations. Look for the examples using JsdocTag
.
Thanks for the suggestion! This works for me:
module.exports = {
rules: {
'jsdoc/no-restricted-syntax': [
'error',
{
contexts: [
{
comment: 'JsdocBlock:has(JsdocTag[tag=typedef][parsedType.value=/object/i])',
message: 'Omit the object type from typedef'
}
]
}
]
}
}
Motivation
There are 3 ways to define object type defs (that I know of):
I would like to enforce one consistently. Personally I prefer the first variant.
Current behavior
N/A
Desired behavior
A new ESLint rule to enforce a consistent way to write object typedefs.
Alternatives considered
The name can be different. The options can be different.