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
23 changes: 15 additions & 8 deletions crates/oxc_linter/src/rules/eslint/no_empty_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,22 @@ declare_oxc_lint!(
/// Empty functions can reduce readability because readers need to guess whether it's
/// intentional or not. So writing a clear comment for empty functions is a good practice.
///
/// ### Configuration
/// You may pass an object containing a list of `allow`ed function kinds.
/// For example:
/// ### Options
///
/// #### allow
///
/// `{ type: string[], default: [] }`
///
/// You may pass a list of allowed function kinds, which will allow functions of
/// these kinds to be empty.
///
/// Example:
/// ```json
/// // oxlint.json
/// {
/// "rules": {
/// "no-empty-function": ["error", { "allow": ["functions"] }]
/// }
/// "no-empty-function": [
/// "error",
/// { "allow": ["functions"] }
/// ]
/// }
/// ```
///
Expand Down Expand Up @@ -157,7 +164,7 @@ declare_oxc_lint!(
/// }
///
/// function foo() {
/// return;
/// return;
/// }
/// const add = (a, b) => a + b
///
Expand Down
Loading