New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
valid-types provides error with using import from other file #343
Comments
Indeed, support for the TypeScript /**
* Component.
* @param {import('../properties-list/properties-list.jsx').PropertyType} prop Property.
*/
const DownloadList = ({ files }) => {}; Please be sure to restart your IDE after you have installed updates to |
I expect this is a stale files issue, so closing, but feel free to comment further and we can reopen if we can replicate. |
@brettz Thank you for answer. I have problem with lint in terminal by yarn. I don't use cache in ESLint. I restart my IDE (VS Code, PHPStorm) but i think that is independent things. |
Ok, and you are sure you have updated to the latest eslint-plugin-jsdoc, along with its dependencies? Your If you have confirmed this, can you reduce your test case to a single erring block, and reduce your |
@brettz9 here is screenshot of I already have only one erring block now. I understood that rule But this rule is necessary for my project. What can i do? |
Ok, good to see you have the dependency, but by a single erring block, I mean you have no other code in the file that triggers the error. And to be safe, try removing all other eslint rules and configs/plugins and paste your exact code and config that still reproduces the issue. |
That config (with old "valid-jsdoc" rule) provides error: {
"rules": {
"valid-jsdoc": [
"error",
{
"prefer": {
"arg": "param",
"argument": "param",
"class": "constructor",
"virtual": "abstract",
"returns": "return"
},
"preferType": {
"any": "*",
"Null": "null",
"Undefined": "undefined",
"Boolean": "boolean",
"Number": "number",
"int": "number",
"integer": "number",
"float": "number",
"String": "string",
"Symbol": "symbol",
"object": "Object",
"array": "Array",
"function": "Function"
},
"requireReturn": false,
"requireReturnType": true,
"requireParamType": true,
"matchDescription": ".+",
"requireParamDescription": true,
"requireReturnDescription": true
}
],
}
} In this code: /**
* Component.
* @param {import('../properties-list/properties-list.jsx').PropertyType} prop Property.
*/
const DownloadList = ({ files }) => {/* ... */}; But i just remove "valid-jsdoc" rule and replace it on rules from this plugin. And it works without errors. |
Ahh, I see, I mistook the "valid-jsdoc" in your previous post as being the same as |
This is still happening on But VS Code does correctly find the type this way: I'm using {
extends: [
"airbnb-base",
"plugin:jsdoc/recommended",
"plugin:prettier/recommended",
],
rules: [
// deprecated rule conflicting with `eslint-plugin-jsdoc`?
"valid-jsdoc": "off",
"require-jsdoc": "off",
],
} ... but also happens with only Maybe this issue came back because of the switch to |
To avoid errors, you need to set |
Thank you, @brettz9, that was the missing piece! |
Hi. Please help me resolve problem with "jsdoc/valid-types" rule. Import of types provides error:
error text: "JSDoc syntax error"
eslint-plugin-jsdoc
version: 15.5.2eslint
version: 6.0.0eslint rule configuration:
The text was updated successfully, but these errors were encountered: