File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
crates/oxc_linter/src/rules/eslint Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use oxc_diagnostics::OxcDiagnostic;
33use oxc_macros:: declare_oxc_lint;
44use oxc_span:: Span ;
55use oxc_syntax:: operator:: UnaryOperator ;
6+ use schemars:: JsonSchema ;
67
78use crate :: { AstNode , ast_util:: outermost_paren_parent, context:: LintContext , rule:: Rule } ;
89
@@ -12,8 +13,10 @@ fn no_void_diagnostic(span: Span) -> OxcDiagnostic {
1213 . with_label ( span)
1314}
1415
15- #[ derive( Debug , Default , Clone ) ]
16+ #[ derive( Debug , Default , Clone , JsonSchema ) ]
17+ #[ serde( rename_all = "camelCase" , default ) ]
1618pub struct NoVoid {
19+ /// If set to `true`, using `void` as a standalone statement is allowed.
1720 pub allow_as_statement : bool ,
1821}
1922
@@ -41,18 +44,11 @@ declare_oxc_lint!(
4144 /// "foo.void()";
4245 /// "foo.void = bar";
4346 /// ```
44- ///
45- /// ### Options
46- ///
47- /// #### allowAsStatement
48- ///
49- /// `{ type: boolean, default: false }`
50- ///
51- /// If set to `true`, using `void` as a standalone statement is allowed.
5247 NoVoid ,
5348 eslint,
5449 restriction,
55- suggestion
50+ suggestion,
51+ config = NoVoid ,
5652) ;
5753
5854impl Rule for NoVoid {
You can’t perform that action at this time.
0 commit comments