Skip to content

Commit 0cedee7

Browse files
committed
Fixed broken links
1 parent f1f817a commit 0cedee7

File tree

3 files changed

+40
-31
lines changed

3 files changed

+40
-31
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ Enforce all the rules in this category with:
9797

9898
| Rule ID | Description | |
9999
|:--------|:------------|:---|
100-
| [vue-scoped-css/no-parsing-error](./no-parsing-error.md) | Disallow parsing errors in `<style>` | |
101-
| [vue-scoped-css/no-unused-keyframes](./no-unused-keyframes.md) | Reports the `@keyframes` is not used in Scoped CSS. | |
102-
| [vue-scoped-css/no-unused-selector](./no-unused-selector.md) | Reports selectors defined in Scoped CSS not used in `<template>`. | |
103-
| [vue-scoped-css/require-scoped](./require-scoped.md) | Enforce the `<style>` tags to has the `scoped` attribute. | |
100+
| [vue-scoped-css/no-parsing-error](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-parsing-error.html) | Disallow parsing errors in `<style>` | |
101+
| [vue-scoped-css/no-unused-keyframes](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-keyframes.html) | Reports the `@keyframes` is not used in Scoped CSS. | |
102+
| [vue-scoped-css/no-unused-selector](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/no-unused-selector.html) | Reports selectors defined in Scoped CSS not used in `<template>`. | |
103+
| [vue-scoped-css/require-scoped](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-scoped.html) | Enforce the `<style>` tags to has the `scoped` attribute. | |
104104

105105
## Uncategorized
106106

@@ -119,7 +119,7 @@ For example:
119119

120120
| Rule ID | Description | |
121121
|:--------|:------------|:---|
122-
| [vue-scoped-css/require-selector-used-inside](./require-selector-used-inside.md) | Reports the defined selectors is not used inside `<template>`. | |
122+
| [vue-scoped-css/require-selector-used-inside](https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/require-selector-used-inside.html) | Reports the defined selectors is not used inside `<template>`. | |
123123

124124
<!--RULES_TABLE_END-->
125125
<!--RULES_SECTION_END-->

tools/render-rules.ts

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,43 @@ import categories from "./lib/categories"
22
import { Rule } from "../lib/types"
33
import { rules } from "../lib/utils/rules"
44

5-
// -----------------------------------------------------------------------------
6-
7-
//eslint-disable-next-line require-jsdoc
8-
function toRuleRow(rule: Rule) {
9-
const mark = `${rule.meta.fixable ? ":wrench:" : ""}${
10-
rule.meta.deprecated ? ":warning:" : ""
11-
}`
12-
const link = `[${rule.meta.docs.ruleId}](./${rule.meta.docs.ruleName}.md)`
13-
const description = rule.meta.docs.description || "(no description)"
14-
15-
return `| ${link} | ${description} | ${mark} |`
16-
}
17-
18-
//eslint-disable-next-line require-jsdoc
19-
function toDeprecatedRuleRow(rule: Rule) {
20-
const link = `[${rule.meta.docs.ruleId}](./${rule.meta.docs.ruleName}.md)`
21-
const replacedRules = rule.meta.docs.replacedBy || []
22-
const replacedBy = replacedRules
23-
.map(name => `[vue-scoped-css/${name}](./${name}.md)`)
24-
.join(", ")
25-
26-
return `| ${link} | ${replacedBy || "(no replacement)"} |`
27-
}
28-
295
//eslint-disable-next-line require-jsdoc
30-
export default function renderRulesTableContent() {
6+
export default function renderRulesTableContent(
7+
buildRulePath = (ruleName: string) => `./${ruleName}.md`,
8+
) {
319
const uncategorizedRules = rules.filter(
3210
rule => !rule.meta.docs.category && !rule.meta.deprecated,
3311
)
3412
const deprecatedRules = rules.filter(rule => rule.meta.deprecated)
3513

14+
// -----------------------------------------------------------------------------
15+
16+
//eslint-disable-next-line require-jsdoc
17+
function toRuleRow(rule: Rule) {
18+
const mark = `${rule.meta.fixable ? ":wrench:" : ""}${
19+
rule.meta.deprecated ? ":warning:" : ""
20+
}`
21+
const link = `[${rule.meta.docs.ruleId}](${buildRulePath(
22+
rule.meta.docs.ruleName,
23+
)})`
24+
const description = rule.meta.docs.description || "(no description)"
25+
26+
return `| ${link} | ${description} | ${mark} |`
27+
}
28+
29+
//eslint-disable-next-line require-jsdoc
30+
function toDeprecatedRuleRow(rule: Rule) {
31+
const link = `[${rule.meta.docs.ruleId}](${buildRulePath(
32+
rule.meta.docs.ruleName,
33+
)})`
34+
const replacedRules = rule.meta.docs.replacedBy || []
35+
const replacedBy = replacedRules
36+
.map(name => `[vue-scoped-css/${name}](${buildRulePath(name)}.md)`)
37+
.join(", ")
38+
39+
return `| ${link} | ${replacedBy || "(no replacement)"} |`
40+
}
41+
3642
// -----------------------------------------------------------------------------
3743
let rulesTableContent = categories
3844
.map(category =>

tools/update-readme.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import os from "os"
44
import renderRulesTableContent from "./render-rules"
55
const isWin = os.platform().startsWith("win")
66

7-
let insertText = `\n${renderRulesTableContent()}\n`
7+
let insertText = `\n${renderRulesTableContent(
8+
name =>
9+
`https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/${name}.html`,
10+
)}\n`
811
if (isWin) {
912
insertText = insertText
1013
.replace(/\r?\n/gu, "\n")

0 commit comments

Comments
 (0)