File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1077,7 +1077,8 @@ impl RuleRunner for crate::rules::import::no_absolute_path::NoAbsolutePath {
10771077}
10781078
10791079impl RuleRunner for crate :: rules:: import:: no_amd:: NoAmd {
1080- const NODE_TYPES : Option < & AstTypesBitset > = None ;
1080+ const NODE_TYPES : Option < & AstTypesBitset > =
1081+ Some ( & AstTypesBitset :: from_types ( & [ AstType :: CallExpression ] ) ) ;
10811082 const RUN_FUNCTIONS : RuleRunFunctionsImplemented = RuleRunFunctionsImplemented :: Run ;
10821083}
10831084
Original file line number Diff line number Diff line change @@ -51,12 +51,10 @@ declare_oxc_lint!(
5151/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-amd.md>
5252impl Rule for NoAmd {
5353 fn run < ' a > ( & self , node : & AstNode < ' a > , ctx : & LintContext < ' a > ) {
54- // not in top level
55- if node. scope_id ( ) != ctx. scoping ( ) . root_scope_id ( ) {
56- return ;
57- }
5854 if let AstKind :: CallExpression ( call_expr) = node. kind ( )
5955 && let Expression :: Identifier ( identifier) = & call_expr. callee
56+ // must be in top level
57+ && node. scope_id ( ) == ctx. scoping ( ) . root_scope_id ( )
6058 {
6159 if identifier. name != "define" && identifier. name != "require" {
6260 return ;
You can’t perform that action at this time.
0 commit comments