-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
rule no-undefined-types does not work #109
Comments
How come the test passes but the actual behavior is different? Is this a problem with the test suite? |
I'm no longer seeing this issue. @DarkPark , can you confirm? |
(This test is now a part of the suite, so I assume it has since been fixed.) |
@brettz9 unfortunately the problem remains. $ eslint/bin/eslint.js -v
v5.16.0 Run check with the config.js: $ eslint/bin/eslint.js -c config.js test.js
v5.16.0 Result:
There are some other unrelated expected issues here, please ignore them. |
Did you check against |
no |
Ok, well, you can try changing to the following (and running "devDependencies": {
"eslint-plugin-jsdoc": "https://github.com/gajus/eslint-plugin-jsdoc"
} |
strange but your advice doesn't work at all
There are only 3 files in node_modules/eslint-plugin-jsdoc:
|
anyway I've used npm package "eslint-plugin-jsdoc": "^4.8.4" |
Oh, my apologies! 4.8.4 should be ok and the Github address won't work as the |
And you ran |
yes
|
I set up a local repository with this module.exports = {
parserOptions: {
"ecmaVersion": 6
},
plugins: ['jsdoc'],
rules: {
'jsdoc/check-param-names': 1,
'jsdoc/check-tag-names': 1,
'jsdoc/check-types': 1,
'jsdoc/newline-after-description': 1,
'jsdoc/no-undefined-types': 1,
'jsdoc/require-description': 0,
'jsdoc/require-description-complete-sentence': 0,
'jsdoc/require-example': 0,
'jsdoc/require-hyphen-before-param-description': 1,
'jsdoc/require-param': 1,
'jsdoc/require-param-description': 1,
'jsdoc/require-param-name': 1,
'jsdoc/require-param-type': 1,
'jsdoc/require-returns-description': 1,
'jsdoc/require-returns-type': 1,
'jsdoc/valid-types': 1
}
} and this test file, const MyType = require('my-library').MyType;
/**
* @param {MyType} foo - Bar.
*/
function quux(foo) {
} and this {
"name": "eslint-plugin-jsdoc-test-109",
"version": "1.0.0",
"description": "",
"main": ".eslintrc.js",
"scripts": {
"eslint": "eslint .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"eslint": "^5.16.0",
"eslint-plugin-jsdoc": "^4.8.4"
}
} and running |
Just making sure you actually ran |
@brettz9 thanks
commenting these two lines:
resolves the issue though I don't understand how it works |
Ok, and I see |
thank you, as I really need to use |
I've submitted PR #222 as a fix; it is now passing in Node/commonjs in my testing added to the PR, so we'll see about it possibly getting merged. |
thanks |
🎉 This issue has been resolved in version 6.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
it works |
Excellent! |
eslint version: 5.9.0
eslint-plugin-jsdoc version: 3.9.1
Config:
Your own example:
gives the error
warning The type 'MyType' is undefined jsdoc/no-undefined-types
The text was updated successfully, but these errors were encountered: