My current settings is:
// ...
"eslintConfig": {
// ...
"settings": {
"jsdoc": {
"preferredTypes": {
"Iterable": "Iterable"
}
}
}
},
// ...
How to add the Iterable type to do what?
Do you want to forbid it, recommend a new name, or what?
I got the error: The type 'Iterable' is undefined.eslint(jsdoc/no-undefined-types)
Assuming you have a type Iterable, the simplest solution is for you to add it as part of the definedTypes option within your jsdoc/no-undefined-types rule:
"eslintConfig": {
"rules": {
...
"jsdoc/no-undefined-types": ["error", {"definedTypes": ["Iterable"]}]
...
}
}
The setting you have referenced would be useful in cases like where you were already calling for renaming some bad type names into a different preferred type name, the preferredTypesDefined option will assume the renaming targets exist as types, allowing you to avoid adding such types again to definedTypes:
"eslintConfig": {
"rules": {
...
"jsdoc/no-undefined-types": ["error", {"preferredTypesDefined": true}]
...
},
"settings": {
"jsdoc": {
"preferredTypes": {
"BadlyNamedIterableType": "Iterable"
}
}
}
}
That should answer it, so closing, though feel free to comment further or reopen as needed.
Thanks :clap: