Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f8ad848

Browse files
author
Josh Goldberg
authored
docs(eslint-plugin): change createRule usage to point to website (typescript-eslint#4369)
1 parent a9eb0b9 commit f8ad848

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { ESLintUtils } from '@typescript-eslint/experimental-utils';
22

3-
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
4-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
5-
const version: string = require('../../package.json').version;
6-
73
export const createRule = ESLintUtils.RuleCreator(
8-
name =>
9-
`https://github.com/typescript-eslint/typescript-eslint/blob/v${version}/packages/eslint-plugin/docs/rules/${name}.md`,
4+
name => `https://typescript-eslint.io/rules/${name}`,
105
);

packages/eslint-plugin/tests/docs.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ describe('Validating rule metadata', () => {
118118
it('`name` field in rule must match the filename', () => {
119119
// validate if rule name is same as url
120120
// there is no way to access this field but its used only in generation of docs url
121-
expect(
122-
rule.meta.docs?.url?.endsWith(`rules/${ruleName}.md`),
123-
).toBeTruthy();
121+
expect(rule.meta.docs?.url).toBe(
122+
`https://typescript-eslint.io/rules/${ruleName}`,
123+
);
124124
});
125125

126126
it('`requiresTypeChecking` should be set if the rule uses type information', () => {

0 commit comments

Comments
 (0)