Skip to content

Commit dd4c9d2

Browse files
authored
docs(linter): Add configuration option docs for eslint/getter-return rule. (#15081)
Part of #14743. Generated docs: ```md ## Configuration This rule accepts a configuration object with the following properties: ### allowImplicit type: `boolean` default: `false` When set to `true`, allows getters to implicitly return `undefined` with a `return` statement containing no expression. ```
1 parent 008e67a commit dd4c9d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

crates/oxc_linter/src/rules/eslint/getter_return.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use oxc_cfg::{
1515
use oxc_diagnostics::OxcDiagnostic;
1616
use oxc_macros::declare_oxc_lint;
1717
use oxc_span::Span;
18+
use schemars::JsonSchema;
1819

1920
use crate::{
2021
AstNode,
@@ -28,8 +29,10 @@ fn getter_return_diagnostic(span: Span) -> OxcDiagnostic {
2829
.with_label(span)
2930
}
3031

31-
#[derive(Debug, Default, Clone)]
32+
#[derive(Debug, Default, Clone, JsonSchema)]
33+
#[serde(rename_all = "camelCase", default)]
3234
pub struct GetterReturn {
35+
/// When set to `true`, allows getters to implicitly return `undefined` with a `return` statement containing no expression.
3336
pub allow_implicit: bool,
3437
}
3538

@@ -79,7 +82,8 @@ declare_oxc_lint!(
7982
/// ```
8083
GetterReturn,
8184
eslint,
82-
nursery
85+
nursery,
86+
config = GetterReturn
8387
);
8488

8589
impl Rule for GetterReturn {

0 commit comments

Comments
 (0)