File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 3
3
* @author Yann Braga
4
4
*/
5
5
6
- import { findVariable } from '@typescript-eslint/experimental-utils/dist/ast -utils'
6
+ import { ASTUtils } from '@typescript-eslint/experimental-utils'
7
7
import { ExportNamedDeclaration } from '@typescript-eslint/types/dist/ast-spec'
8
8
import { isExportStory } from '@storybook/csf'
9
9
@@ -86,7 +86,7 @@ export = createStorybookRule({
86
86
87
87
const scope = context . getScope ( ) . childScopes [ 0 ]
88
88
if ( scope ) {
89
- const variable = findVariable ( scope , name )
89
+ const variable = ASTUtils . findVariable ( scope , name )
90
90
for ( let i = 0 ; i < variable ?. references ?. length ; i ++ ) {
91
91
const ref = variable . references [ i ]
92
92
if ( ! ref . init ) {
Original file line number Diff line number Diff line change 1
1
import { isExportStory } from '@storybook/csf'
2
2
import { ExportDefaultDeclaration } from '@typescript-eslint/types/dist/ast-spec'
3
- import { findVariable } from '@typescript-eslint/experimental-utils/dist/ast -utils'
3
+ import { ASTUtils } from '@typescript-eslint/experimental-utils'
4
4
import {
5
5
isFunctionDeclaration ,
6
6
isIdentifier ,
@@ -21,7 +21,7 @@ export const isPlayFunction = (node: any) => {
21
21
export const getMetaObjectExpression = ( node : ExportDefaultDeclaration , context : any ) => {
22
22
let meta = node . declaration
23
23
if ( isIdentifier ( meta ) ) {
24
- const variable = findVariable ( context . getScope ( ) , meta . name )
24
+ const variable = ASTUtils . findVariable ( context . getScope ( ) , meta . name )
25
25
const decl = variable && variable . defs . find ( ( def ) => isVariableDeclarator ( def . node ) )
26
26
if ( decl && isVariableDeclarator ( decl . node ) ) {
27
27
meta = decl . node . init
You can’t perform that action at this time.
0 commit comments