Skip to content

Commit 15e4f44

Browse files
committed
fix: replace uses of context.getFilename
1 parent 5c83d70 commit 15e4f44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rules/consistent-data-testid.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createTestingLibraryRule } from '../create-testing-library-rule';
22
import { isJSXAttribute, isLiteral } from '../node-utils';
3+
import { getFilename } from '../utils';
34

45
export const RULE_NAME = 'consistent-data-testid';
56
export type MessageIds =
@@ -77,11 +78,10 @@ export default createTestingLibraryRule<Options, MessageIds>({
7778
},
7879

7980
create: (context, [options]) => {
80-
const { getFilename } = context;
8181
const { testIdPattern, testIdAttribute: attr, customMessage } = options;
8282

8383
function getFileNameData() {
84-
const splitPath = getFilename().split('/');
84+
const splitPath = getFilename(context).split('/');
8585
const fileNameWithExtension = splitPath.pop() ?? '';
8686
if (
8787
fileNameWithExtension.includes('[') ||

0 commit comments

Comments
 (0)