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

Define contexts globally #857

Closed
iliubinskii opened this issue Mar 26, 2022 · 2 comments · Fixed by #980
Closed

Define contexts globally #857

iliubinskii opened this issue Mar 26, 2022 · 2 comments · Fixed by #980

Comments

@iliubinskii
Copy link

Motivation

jsdoc plugin has around 20 rules that have "contexts" setting.

Is it possible to globally set default "contexts" for all rules that use this setting?

Current behavior

I had to discover which rules have "contexts" and configure each of them.

Desired behavior

I would prefer to have some global "contexts" configuration.

@brettz9
Copy link
Collaborator

brettz9 commented Mar 26, 2022

Yes, I think we could allow any settings.jsdoc.contexts contexts to be automatically added though while still allowing those individual options--since a project might not want every rule to behave the same.

The jsdoc/require-jsdoc rule has its own additional property allowed on the contexts objects (used to indicate whether the JSDoc block to be created by our fixer should be inline or not), so our global settings contexts should allow that extra property, even though the other rules will not use this extra property.

Similarly, the rule no-missing-syntax has additional properties which we might safely ignore. Since the user wants these structures present, perhaps it is safe to insist that a no-missing-syntax context added globally as a settings context could be shared among other contexts for use by any rule.

However, in the case of the no-restricted-syntax rule, its contexts would not want to be obtained from the global contexts since that rule is prohibiting structures in a given context.

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 3, 2023
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 3, 2023
…om global settings; fixes gajus#857

Also:
- fix(`no-missing-syntax`, `no-restricted-syntax`): error message (`context` -> `contexts`)
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 3, 2023
…om global settings; fixes gajus#857

Also:
- fix(`no-missing-syntax`, `no-restricted-syntax`): error message (`context` -> `contexts`)
brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this issue Feb 11, 2023
…om global settings; fixes gajus#857

Also:
- fix(`no-missing-syntax`, `no-restricted-syntax`): error message (`context` -> `contexts`)
brettz9 added a commit that referenced this issue Feb 11, 2023
…om global settings; fixes #857

Also:
- fix(`no-missing-syntax`, `no-restricted-syntax`): error message (`context` -> `contexts`)
@github-actions
Copy link

🎉 This issue has been resolved in version 39.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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