Skip to content

Commit f09203e

Browse files
UserbitSimenB
authored andcommitted
fix: get correct ruleName without specifying file extension (#473)
1 parent b4868be commit f09203e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rules/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// TODO: rename to utils.ts when TS migration is complete
2-
import { basename } from 'path';
2+
import { parse as parsePath } from 'path';
33
import {
44
AST_NODE_TYPES,
55
ESLintUtils,
@@ -11,7 +11,7 @@ import { version } from '../../package.json';
1111
const REPO_URL = 'https://github.com/jest-community/eslint-plugin-jest';
1212

1313
export const createRule = ESLintUtils.RuleCreator(name => {
14-
const ruleName = basename(name, '.ts');
14+
const ruleName = parsePath(name).name;
1515
return `${REPO_URL}/blob/v${version}/docs/rules/${ruleName}.md`;
1616
});
1717

0 commit comments

Comments
 (0)