Skip to content

Commit de9fdca

Browse files
authored
Merge pull request #76 from tombakerjr/fix-ast-utils-import
Fix ast-utils import
2 parents fd0086d + 39c3c64 commit de9fdca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/rules/prefer-pascal-case.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @author Yann Braga
44
*/
55

6-
import { findVariable } from '@typescript-eslint/experimental-utils/dist/ast-utils'
6+
import { ASTUtils } from '@typescript-eslint/experimental-utils'
77
import { ExportNamedDeclaration } from '@typescript-eslint/types/dist/ast-spec'
88
import { isExportStory } from '@storybook/csf'
99

@@ -86,7 +86,7 @@ export = createStorybookRule({
8686

8787
const scope = context.getScope().childScopes[0]
8888
if (scope) {
89-
const variable = findVariable(scope, name)
89+
const variable = ASTUtils.findVariable(scope, name)
9090
for (let i = 0; i < variable?.references?.length; i++) {
9191
const ref = variable.references[i]
9292
if (!ref.init) {

lib/utils/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isExportStory } from '@storybook/csf'
22
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'
44
import {
55
isFunctionDeclaration,
66
isIdentifier,
@@ -21,7 +21,7 @@ export const isPlayFunction = (node: any) => {
2121
export const getMetaObjectExpression = (node: ExportDefaultDeclaration, context: any) => {
2222
let meta = node.declaration
2323
if (isIdentifier(meta)) {
24-
const variable = findVariable(context.getScope(), meta.name)
24+
const variable = ASTUtils.findVariable(context.getScope(), meta.name)
2525
const decl = variable && variable.defs.find((def) => isVariableDeclarator(def.node))
2626
if (decl && isVariableDeclarator(decl.node)) {
2727
meta = decl.node.init

0 commit comments

Comments
 (0)