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(linter/jsdoc): Implement require-yields rule #3150

Merged
merged 12 commits into from
May 2, 2024
8 changes: 4 additions & 4 deletions crates/oxc_linter/src/config/settings/jsdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub struct JSDocPluginSettings {
pub override_replaces_docs: bool,
/// Only for `require-(yields|returns|description|example|param|throws)` rule
#[serde(default, rename = "augmentsExtendsReplacesDocs")]
pub arguments_extends_replaces_docs: bool,
pub augments_extends_replaces_docs: bool,
/// Only for `require-(yields|returns|description|example|param|throws)` rule
#[serde(default, rename = "implementsReplacesDocs")]
pub implements_replaces_docs: bool,
Expand Down Expand Up @@ -79,7 +79,7 @@ impl Default for JSDocPluginSettings {
// Exists only for these defaults
ignore_replaces_docs: true,
override_replaces_docs: true,
arguments_extends_replaces_docs: false,
augments_extends_replaces_docs: false,
implements_replaces_docs: false,
exempt_destructured_roots_from_checks: false,
tag_name_preference: FxHashMap::default(),
Expand Down Expand Up @@ -202,7 +202,7 @@ mod test {
assert_eq!(settings.tag_name_preference.len(), 0);
assert!(settings.ignore_replaces_docs);
assert!(settings.override_replaces_docs);
assert!(!settings.arguments_extends_replaces_docs);
assert!(!settings.augments_extends_replaces_docs);
assert!(!settings.implements_replaces_docs);

let settings = JSDocPluginSettings::default();
Expand All @@ -212,7 +212,7 @@ mod test {
assert_eq!(settings.tag_name_preference.len(), 0);
assert!(settings.ignore_replaces_docs);
assert!(settings.override_replaces_docs);
assert!(!settings.arguments_extends_replaces_docs);
assert!(!settings.augments_extends_replaces_docs);
assert!(!settings.implements_replaces_docs);
}

Expand Down
2 changes: 2 additions & 0 deletions crates/oxc_linter/src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ mod jsdoc {
pub mod require_property_description;
pub mod require_property_name;
pub mod require_property_type;
pub mod require_yields;
}

mod tree_shaking {
Expand Down Expand Up @@ -710,5 +711,6 @@ oxc_macros::declare_all_lint_rules! {
jsdoc::require_property_type,
jsdoc::require_property_name,
jsdoc::require_property_description,
jsdoc::require_yields,
tree_shaking::no_side_effects_in_initialization,
}
Loading
Loading