Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: get correct ruleName without specifying file extension #473

Merged
merged 2 commits into from Nov 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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