-
-
Notifications
You must be signed in to change notification settings - Fork 722
Labels
A-linterArea - LinterArea - Linter
Description
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:
oxc/crates/oxc_linter/src/rules/eslint/no_empty_function.rs
Lines 27 to 62 in d4687e7
| #[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
Assignees
Labels
A-linterArea - LinterArea - Linter