Skip to content

Commit

Permalink
feat(rulegen): add fix capabilities to new rule template (#4558)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Jul 31, 2024
1 parent b952942 commit 247b2af
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tasks/rulegen/template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;

use crate::{context::LintContext, rule::Rule, AstNode};
use crate::{
context::LintContext,
fixer::{RuleFixer, RuleFix},
rule::Rule,
AstNode
};

#[derive(Debug, Default, Clone)]
pub struct {{pascal_rule_name}};
Expand All @@ -20,6 +25,10 @@ declare_oxc_lint!(
{{pascal_rule_name}},
nursery, // TODO: change category to `correctness`, `suspicious`, `pedantic`, `perf`, `restriction`, or `style`
// See <https://oxc.rs/docs/contribute/linter.html#rule-category> for details

pending // TODO: describe fix capabilities. Remove if no fix can be done,
// keep at 'pending' if you think one could be added but don't know how.
// Options are 'fix', 'fix-dangerous', 'suggestion', and 'suggestion-dangerous'
);

impl Rule for {{pascal_rule_name}} {
Expand Down

0 comments on commit 247b2af

Please sign in to comment.