Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_semantic::{ReferenceId, ScopeFlags, ScopeId, SymbolId};
use oxc_span::{Atom, GetSpan, Span};
use schemars::JsonSchema;

use crate::{
AstNode,
Expand Down Expand Up @@ -51,8 +52,10 @@ fn consistent_function_scoping(
}
}

#[derive(Debug, Clone)]
#[derive(Debug, Clone, JsonSchema)]
#[serde(rename_all = "camelCase", default)]
pub struct ConsistentFunctionScoping {
/// Whether to check scoping with arrow functions.
check_arrow_functions: bool,
}

Expand Down Expand Up @@ -110,21 +113,6 @@ declare_oxc_lint!(
/// return doBar;
/// }
/// ```
/// ### Options
///
/// #### checkArrowFunctions
///
/// `{ type: boolean, default: true }`
///
/// Pass `"checkArrowFunctions": false` to disable linting of arrow functions.
///
/// Example:
/// ```json
/// "unicorn/consistent-function-scoping": [
/// "error",
/// { "checkArrowFunctions": false }
/// ]
/// ```
///
/// ### Limitations
///
Expand Down Expand Up @@ -166,7 +154,8 @@ declare_oxc_lint!(
ConsistentFunctionScoping,
unicorn,
suspicious,
pending
pending,
config = ConsistentFunctionScoping,
);

impl Rule for ConsistentFunctionScoping {
Expand Down
Loading