@@ -75,7 +75,6 @@ inside the `semantic_analyzers` folder
7575 use rome_analyze::context::RuleContext;
7676
7777 impl Rule for UseAwesomeTricks {
78- const CATEGORY: RuleCategory = RuleCategory::Lint;
7978 type Query = Semantic<JsAnyExpression>;
8079 type State = String;
8180 type Signals = Option<Self::State>;
@@ -84,14 +83,13 @@ inside the `semantic_analyzers` folder
8483 fn run(ctx: &RuleContext<Self>) -> Self::Signals {}
8584 }
8685 ```
87- 5 . the const ` CATEGORY ` must be ` RuleCategory::Lint ` otherwise it won't work
88- 6 . the ` Query ` needs to have the ` Semantic ` type, because we want to have access to the semantic model.
86+ 5 . the ` Query ` needs to have the ` Semantic ` type, because we want to have access to the semantic model.
8987` Query ` tells the engine on which AST node we want to trigger the rule.
90- 7 . The ` State ` type doesn't have to be used, so it can be considered optional, but it has
88+ 6 . The ` State ` type doesn't have to be used, so it can be considered optional, but it has
9189be defined as ` type State = () `
92- 8 . The ` run ` function must be implemented. This function is called every time the analyzer
90+ 7 . The ` run ` function must be implemented. This function is called every time the analyzer
9391finds a match for the query specified by the rule, and may return zero or more "signals".
94- 9 . Implement the optional ` diagnostic ` function, to tell the user where's the error and why:
92+ 8 . Implement the optional ` diagnostic ` function, to tell the user where's the error and why:
9593 ``` rust,ignore
9694 impl Rule for UseAwesomeTricks {
9795 // .. code
@@ -104,7 +102,7 @@ finds a match for the query specified by the rule, and may return zero or more "
104102
105103 You will have to manually update the file `rome_diagnostics_categories/src/categories.rs` and add a new category
106104 for the new rule you're about to create.
107- 10 . Implement the optional `action` function, if we are able to provide automatic code fix to the rule:
105+ 9 . Implement the optional `action` function, if we are able to provide automatic code fix to the rule:
108106 ```rust,ignore
109107 impl Rule for UseAwesomeTricks {
110108 // .. code
0 commit comments