From 2329b01eec56d2ef3d9e68d8208e8e3993cacad6 Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Tue, 30 Jul 2024 15:29:26 -0400 Subject: [PATCH] feat(rulegen): add fix capabilities to new rule template --- tasks/rulegen/template.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/rulegen/template.txt b/tasks/rulegen/template.txt index e55ffddcfdc7f6..bd3ffa55e9a046 100644 --- a/tasks/rulegen/template.txt +++ b/tasks/rulegen/template.txt @@ -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}}; @@ -20,6 +25,10 @@ declare_oxc_lint!( {{pascal_rule_name}}, nursery, // TODO: change category to `correctness`, `suspicious`, `pedantic`, `perf`, `restriction`, or `style` // See 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}} {