File tree 1 file changed +8
-4
lines changed
crates/oxc_linter/src/rules/nextjs
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -47,16 +47,20 @@ const NEXTJS_DATA_FETCHING_FUNCTIONS: phf::Set<&'static str> = phf_set! {
47
47
const THRESHOLD : i32 = 1 ;
48
48
49
49
impl Rule for NoTypos {
50
- fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
50
+ fn should_run ( & self , ctx : & LintContext ) -> bool {
51
51
let Some ( path) = ctx. file_path ( ) . to_str ( ) else {
52
- return ;
52
+ return false ;
53
53
} ;
54
54
let Some ( path_after_pages) = path. split ( "pages" ) . nth ( 1 ) else {
55
- return ;
55
+ return false ;
56
56
} ;
57
57
if path_after_pages. starts_with ( "/api" ) {
58
- return ;
58
+ return false ;
59
59
}
60
+ true
61
+ }
62
+
63
+ fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
60
64
if let AstKind :: ModuleDeclaration ( ModuleDeclaration :: ExportNamedDeclaration ( en_decl) ) =
61
65
node. kind ( )
62
66
{
You can’t perform that action at this time.
0 commit comments