@@ -5,14 +5,15 @@ import { createRule } from '../utils';
5
5
import type { RuleContext } from '../types' ;
6
6
import { findVariable } from '../utils/ast-utils' ;
7
7
import { traverseNodes } from 'svelte-eslint-parser' ;
8
+ import { getSourceCode } from '../utils/compat' ;
8
9
9
10
/**
10
11
* Get usage of `tick`
11
12
*/
12
13
function extractTickReferences (
13
14
context : RuleContext
14
15
) : { node : TSESTree . CallExpression ; name : string } [ ] {
15
- const referenceTracker = new ReferenceTracker ( context . getSourceCode ( ) . scopeManager . globalScope ! ) ;
16
+ const referenceTracker = new ReferenceTracker ( getSourceCode ( context ) . scopeManager . globalScope ! ) ;
16
17
const a = referenceTracker . iterateEsmReferences ( {
17
18
svelte : {
18
19
[ ReferenceTracker . ESM ] : true ,
@@ -35,7 +36,7 @@ function extractTickReferences(
35
36
function extractTaskReferences (
36
37
context : RuleContext
37
38
) : { node : TSESTree . CallExpression ; name : string } [ ] {
38
- const referenceTracker = new ReferenceTracker ( context . getSourceCode ( ) . scopeManager . globalScope ! ) ;
39
+ const referenceTracker = new ReferenceTracker ( getSourceCode ( context ) . scopeManager . globalScope ! ) ;
39
40
const a = referenceTracker . iterateGlobalReferences ( {
40
41
setTimeout : { [ ReferenceTracker . CALL ] : true } ,
41
42
setInterval : { [ ReferenceTracker . CALL ] : true } ,
@@ -122,7 +123,7 @@ function isPromiseThenOrCatchBody(node: TSESTree.Node): boolean {
122
123
* Get all reactive variable reference.
123
124
*/
124
125
function getReactiveVariableReferences ( context : RuleContext ) {
125
- const scopeManager = context . getSourceCode ( ) . scopeManager ;
126
+ const scopeManager = getSourceCode ( context ) . scopeManager ;
126
127
// Find the top-level (module or global) scope.
127
128
// Any variable defined at the top-level (module scope or global scope) can be made reactive.
128
129
const toplevelScope =
0 commit comments