Navigation Menu

Skip to content

Commit

Permalink
fix: get correct ruleName without specifying file extension (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
Userbit authored and SimenB committed Nov 14, 2019
1 parent b4868be commit f09203e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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,
Expand All @@ -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`;
});

Expand Down

0 comments on commit f09203e

Please sign in to comment.