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

feat: structuredTags setting to control type/name portions of existing or custom tags #610

Merged
merged 2 commits into from Jul 19, 2020

Conversation

brettz9
Copy link
Collaborator

@brettz9 brettz9 commented Jul 15, 2020

feat(check-types, no-undefined-types, valid-types): Add structuredTags setting to control whether the type and namepath portions should be checked for validity and whether such portions are required, and to let user-defined "namepath-defining" tags be added to defined types. Closes #481

BREAKING CHANGE:

Drops checkSeesForNamepaths setting. Use {settings: {jsdoc: {structuredTags: {name: 'namepath', type: false, required: ['name'],}}}} instead.

Also:

  1. Clarifies in more cases where a problem is specific to the mode or not
  2. Reports simultaneous invalid name and type errors
  3. typdef now requires allowEmptyNamepaths: false, to report empty names (as with other tags)
  4. Requires a name for event and external (and extends in jsdoc mode); some tweaking of other tags per docs

(Also does some jsdocUtil refactoring along the way to pull tag meta-data all into one map for easier management and to minimize tag-specific handling blocks within valid-types.)

(Since settings can now throw, needed to add a test to a few other rules to cover such cases.)

…uredTags` setting to control whether the type and namepath portions should be checked for validity and whether such portions are required, and to let user-defined "namepath-defining" tags be added to defined types. Closes gajus#481

BREAKING CHANGE:

Drops `checkSeesForNamepaths` setting. Use `{settings: {jsdoc: {structuredTags: {name: 'namepath', type: false, required: ['name'],}}}}` instead.

Also:
1. Clarifies in more cases where a problem is specific to the mode or not
2. Reports simultaneous invalid name *and* type errors
3. `typdef` now requires `allowEmptyNamepaths: false,` to report empty names (as with other tags)
4. Requires a name for `event` and `external` (and `extends` in jsdoc mode); some tweaking of other tags per docs
@brettz9
Copy link
Collaborator Author

brettz9 commented Jul 18, 2020

Unless there are objections, I'm thinking of also changing this PR to make allowEmptyNamepaths default to false. I think it is better for the default to be stricter for tags which are documented as expecting them.

… ensuring tags which expect names per docs will be reported

Also ensures `see` tag with only an inline link tag is not treated as empty.
@brettz9 brettz9 merged commit 842381a into gajus:master Jul 19, 2020
@gajus
Copy link
Owner

gajus commented Jul 19, 2020

🎉 This PR is included in version 30.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Jul 19, 2020
@brettz9 brettz9 deleted the valid-types-tags branch July 19, 2020 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants