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

Property context isn't working #841

Closed
TimJ0212 opened this issue Feb 17, 2022 · 10 comments
Closed

Property context isn't working #841

TimJ0212 opened this issue Feb 17, 2022 · 10 comments

Comments

@TimJ0212
Copy link

I want to lint uncommented properties. For this, I use the require-jsdoc rule.
In the context of the rule I use the given text Property which is in the documentation of the rule in the context section. But he doesn't lint my uncommented properties.
Thank you for this nice project.

My configuration:

"jsdoc/require-jsdoc": [
             "error",
              {
              "contexts": [
                       "Property"
               ],
              "require": {
                   "ClassDeclaration": true
               },
                    "publicOnly": true,
                    "checkConstructors": false
               }
  ],
@brettz9
Copy link
Collaborator

brettz9 commented Feb 17, 2022

Please provide the requested information. You have not provided any code that you expect to trigger.

@brettz9
Copy link
Collaborator

brettz9 commented Feb 17, 2022

Closing until providing the required information.

@brettz9 brettz9 closed this as completed Feb 17, 2022
@TimJ0212
Copy link
Author

Sorry, I'm working with ts and wrote:

/**
* Some comment.
* /
export class Component {
    public foo?: number;
}

I expected foo to trigger, but I don't get anything linted.

@gajus
Copy link
Owner

gajus commented Feb 18, 2022

🎉 This issue has been resolved in version 37.9.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Feb 18, 2022
crapStone pushed a commit to Calciumdibromid/CaBr2 that referenced this issue Feb 19, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) | devDependencies | patch | [`37.9.2` -> `37.9.4`](https://renovatebot.com/diffs/npm/eslint-plugin-jsdoc/37.9.2/37.9.4) |

---

### Release Notes

<details>
<summary>gajus/eslint-plugin-jsdoc</summary>

### [`v37.9.4`](https://github.com/gajus/eslint-plugin-jsdoc/releases/v37.9.4)

[Compare Source](gajus/eslint-plugin-jsdoc@v37.9.3...v37.9.4)

##### Bug Fixes

-   **`require-jsdoc`:** avoid class jsdoc blocks suppressing errors for `PropertyDefinition`; fixes [#&#8203;841](gajus/eslint-plugin-jsdoc#841) ([ef68427](gajus/eslint-plugin-jsdoc@ef68427))

### [`v37.9.3`](https://github.com/gajus/eslint-plugin-jsdoc/releases/v37.9.3)

[Compare Source](gajus/eslint-plugin-jsdoc@v37.9.2...v37.9.3)

##### Bug Fixes

-   **`no-restricted-syntax`, `no-missing-syntax`:** update jsdoccomment to avoid breaking on bad types (at least until jsdoc-type-pratt-parser may support all expected); fixes [#&#8203;842](gajus/eslint-plugin-jsdoc#842) ([06c3163](gajus/eslint-plugin-jsdoc@06c3163))

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).

Co-authored-by: cabr2-bot <cabr2.help@gmail.com>
Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1180
Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org>
Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
@TimJ0212
Copy link
Author

Sorry to bother you again. But the changes unfortunately have no effect on the behavior. I have applied the configuration of your changes:

"jsdoc/require-jsdoc": ["error", {"checkConstructors":false,"contexts":["PropertyDefinition"],"publicOnly":true}]

And my code remains the same:

/**
 * Some comment.
 */
export class Component {
    public foo?: number;
}

I expect the foo to be linted because no comment is provided. What is my error?

Do you have any idea why it still doesn't work? In related issues, the ECMAScript version was often mentioned, I use es2015. Can this be related to that?

With kind regards

@brettz9
Copy link
Collaborator

brettz9 commented Feb 21, 2022

I have reconfirmed that your exact example is indeed now reporting an error as expected.

If you are linting within an IDE, have you restarted the IDE? Some IDEs require this for the updates to take effect.

If you are still seeing an issue despite running npm install and restarting your IDE if using an IDE, then I think we'd need a minimal reproducible example repo to see if some other subtle configuration was causing an issue.

Re: the ES version, as long as you are using the TypeScript parser (which you need for your code), you shouldn't be getting any complaints, at least from ESLint, related to your choice of ecmaVersion. ES2015 added module support, so unless using dynamic imports, which were added later, I expect you should be fine.

@brettz9
Copy link
Collaborator

brettz9 commented Feb 21, 2022

You might also try removing your node_modules and package lock file and doing a fresh npm install to ensure you have the latest dependencies. I wouldn't expect this to be necessary, but it may be worth a try if you're still seeing an issue.

@TimJ0212
Copy link
Author

Thank you for your quick responses. Sponsor you now, really top.
I have a nx workspace with multiple Angular projects, and I was able to get the correct behavior on a new Angular project and on a new nx workspace.
In the affected workspace I deactivated all other rules, also this brings no change. Would you have any idea what else I might be able to test? I am running out of ideas.

I have deleted and reinstalled the node_modules folder several times. In my package.json I use the latest version.
Are there any conflict configurations that I missed?

Thank you!!

@brettz9
Copy link
Collaborator

brettz9 commented Feb 21, 2022

Thank you for your quick responses. Sponsor you now, really top.

Appreciate the sponsorship, thank you. But so you know, I can't guarantee I can always be super responsive, though I do hope to be for issues that are simple enough to resolve.

I have a nx workspace with multiple Angular projects, and I was able to get the correct behavior on a new Angular project and on a new nx workspace. In the affected workspace I deactivated all other rules, also this brings no change. Would you have any idea what else I might be able to test? I am running out of ideas.

I have deleted and reinstalled the node_modules folder several times. In my package.json I use the latest version. Are there any conflict configurations that I missed?

Hmm. Other nx users reporting a similar problem on #786 though not really sure that would be related. Are you able to report an issue to them or find a support chat or StackOverflow question about it?

@brettz9
Copy link
Collaborator

brettz9 commented Feb 21, 2022

Do you have complex eslintrc settings where one config could be overriding another?

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

No branches or pull requests

3 participants