From f09203ed05a69c83baadf6149ae17513c85b170f Mon Sep 17 00:00:00 2001 From: Userbit <34487074+Userbit@users.noreply.github.com> Date: Thu, 14 Nov 2019 20:55:22 +0300 Subject: [PATCH] fix: get correct ruleName without specifying file extension (#473) --- src/rules/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rules/utils.ts b/src/rules/utils.ts index 12a03709a..b5cb219d4 100644 --- a/src/rules/utils.ts +++ b/src/rules/utils.ts @@ -1,5 +1,5 @@ // TODO: rename to utils.ts when TS migration is complete -import { basename } from 'path'; +import { parse as parsePath } from 'path'; import { AST_NODE_TYPES, ESLintUtils, @@ -11,7 +11,7 @@ import { version } from '../../package.json'; const REPO_URL = 'https://github.com/jest-community/eslint-plugin-jest'; export const createRule = ESLintUtils.RuleCreator(name => { - const ruleName = basename(name, '.ts'); + const ruleName = parsePath(name).name; return `${REPO_URL}/blob/v${version}/docs/rules/${ruleName}.md`; });