Skip to content
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 jsdoc/no-types shoudl not be active at js files #29

Open
mcm1957 opened this issue Dec 27, 2024 · 1 comment
Open

Rule jsdoc/no-types shoudl not be active at js files #29

mcm1957 opened this issue Dec 27, 2024 · 1 comment

Comments

@mcm1957
Copy link
Contributor

mcm1957 commented Dec 27, 2024

The rule jsdoc/no-types should be active for typescript sources only.

For js Moduls a rule requiring type definitions should be active.

Problem discussed at forum, see: https://forum.iobroker.net/topic/78859/iobroker-eslint-config-param-wo-ist-der-fehler

This example should not raise an error / warning:

/**
   * func addTime (02:12:24 + 00:15) \|\| (807) => 02:12:39
   *
   * @param {string\|number} time1 - z.B. 02:12:24 \|\| 807 => 02:12:39
   * @param {string\|number\|undefined} time2 -z.B. 02:12:24 \|\| 807 => 02:12:39 \|\| undef.
   * @returns
   */
   function addTime(time1, time2){
   . . . .
   }
@mcm1957
Copy link
Contributor Author

mcm1957 commented Dec 27, 2024

Looks like this line should be moved to ts area and eventually a js specific include should be specified for js files:

jsdoc.configs['flat/recommended-typescript'],

I think the following rule would be better for js files:
jsdoc.configs['flat/recommended']

Eventually see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/README.md#user-content-eslint-plugin-jsdoc-configuration-flat-config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant