Skip to content

linter: missing options for eslint/no-empty-function #10529

@Sysix

Description

@Sysix

What version of Oxlint are you using?

0.16.7

What command did you run?

No response

What does your .oxlintrc.json config file look like?

No response

What happened?

The ESLint and TS-ESLint rule have some options, which we are currently not supporting:

https://eslint.org/docs/latest/rules/no-empty-function#options

https://typescript-eslint.io/rules/no-empty-function/#options

Our options and docs:

#[derive(Debug, Default, Clone)]
pub struct NoEmptyFunction;
declare_oxc_lint!(
/// ### What it does
/// Disallows the usages of empty functions
///
/// ### Why is this bad?
/// 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.
///
/// ### Example
///
/// Examples of **incorrect** code for this rule:
/// ```javascript
/// function foo() {
/// }
///
/// const bar = () => {};
/// ```
///
/// Examples of **correct** code for this rule:
/// ```javascript
/// function foo() {
/// // do nothing
/// }
///
/// function foo() {
/// return;
/// }
/// const add = (a, b) => a + b
/// ```
NoEmptyFunction,
eslint,
restriction,
);

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions