Skip to content

Commit 5422c8c

Browse files
committed
update readme
1 parent f5c087d commit 5422c8c

File tree

3 files changed

+57
-54
lines changed

3 files changed

+57
-54
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,23 @@ Or enable all rules in extends:
7777

7878
Where rules are included in the configs `recommended`, or `all` it is indicated below.
7979

80-
- [`@pandacss/file-not-included`](docs/rules/file-not-included.md) `all`, `recommended`
81-
- [`@pandacss/no-config-function-in-source`](docs/rules/no-config-function-in-source.md) `all`, `recommended`
82-
- [`@pandacss/no-debug`](docs/rules/no-debug.md) `all`, `recommended`
83-
- [`@pandacss/no-dynamic-styling`](docs/rules/no-dynamic-styling.md) `all`, `recommended`
84-
- [`@pandacss/no-escape-hatch`](docs/rules/no-escape-hatch.md) `all`
85-
- [`@pandacss/no-hardcoded-color`](docs/rules/no-hardcoded-color.md) `all`
86-
- [`@pandacss/no-important`](docs/rules/no-important.md) `all`
87-
- [`@pandacss/no-invalid-token-paths`](docs/rules/no-invalid-token-paths.md) `all`, `recommended`
88-
- [`@pandacss/no-property-renaming`](docs/rules/no-property-renaming.md) `all`, `recommended`
89-
- [`@pandacss/no-unsafe-token-fn-usage`](docs/rules/no-unsafe-token-fn-usage.md) `all`
90-
- [`@pandacss/prefer-longhand-properties`](docs/rules/prefer-longhand-properties.md) `all`
91-
- [`@pandacss/prefer-shorthand-properties`](docs/rules/prefer-shorthand-properties.md) `all`
92-
- [`@pandacss/prefer-atomic-properties`](docs/rules/prefer-atomic-properties.md) `all`
93-
- [`@pandacss/prefer-composite-properties`](docs/rules/prefer-composite-properties.md) `all`
94-
- [`@pandacss/prefer-unified-property-style`](docs/rules/prefer-unified-property-style.md) `all`, `recommended`
80+
| Rule | `recommended` |
81+
| ---------------------------------------------------------------------------------------- | ------------- |
82+
| [`@pandacss/file-not-included`](docs/rules/file-not-included.md) | ✔️ |
83+
| [`@pandacss/no-config-function-in-source`](docs/rules/no-config-function-in-source.md) | ✔️ |
84+
| [`@pandacss/no-debug`](docs/rules/no-debug.md) | ✔️ |
85+
| [`@pandacss/no-dynamic-styling`](docs/rules/no-dynamic-styling.md) | ✔️ |
86+
| [`@pandacss/no-escape-hatch`](docs/rules/no-escape-hatch.md) | |
87+
| [`@pandacss/no-hardcoded-color`](docs/rules/no-hardcoded-color.md) | |
88+
| [`@pandacss/no-important`](docs/rules/no-important.md) | |
89+
| [`@pandacss/no-invalid-token-paths`](docs/rules/no-invalid-token-paths.md) | ✔️ |
90+
| [`@pandacss/no-property-renaming`](docs/rules/no-property-renaming.md) | ✔️ |
91+
| [`@pandacss/no-unsafe-token-fn-usage`](docs/rules/no-unsafe-token-fn-usage.md) | |
92+
| [`@pandacss/prefer-longhand-properties`](docs/rules/prefer-longhand-properties.md) | |
93+
| [`@pandacss/prefer-shorthand-properties`](docs/rules/prefer-shorthand-properties.md) | |
94+
| [`@pandacss/prefer-atomic-properties`](docs/rules/prefer-atomic-properties.md) | |
95+
| [`@pandacss/prefer-composite-properties`](docs/rules/prefer-composite-properties.md) | |
96+
| [`@pandacss/prefer-unified-property-style`](docs/rules/prefer-unified-property-style.md) | ✔️ |
9597

9698
## Settings
9799

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dev": "pnpm -r --parallel dev",
99
"build": "pnpm -r --parallel build",
1010
"test": "vitest run",
11-
"docs": "rm -rf docs/rules && DOCGEN=1 vitest run && node tools/build-readme.js",
11+
"docs": "rm -rf docs/rules && DOCGEN=1 vitest run && pnpm readme",
1212
"readme": "node tools/build-readme.js && pnpm prettier-fix",
1313
"deps": "pnpm -r --parallel deps",
1414
"lint": "eslint . --ext .ts",

tools/build-readme.js

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,45 @@ const pluginName = '@pandacss'
77
const docPath = 'docs/rules/{name}.md'
88

99
function getRules(deprecated) {
10-
return Array.from(rulesWithConfig.keys())
11-
.map((rule) => {
12-
const fullRule = pluginName + '/' + rule
13-
const ruleData = rulesWithConfig.get(rule)
14-
const docs = ruleData.meta.docs
15-
if (!!docs.deprecated === deprecated) {
16-
return (
17-
'* [`' +
18-
fullRule +
19-
'`](' +
20-
docPath.replace('{name}', rule) +
21-
')' +
22-
(ruleData.meta.schema.length ? ' ⚙️' : '') +
23-
(ruleData.meta.fixable ? ' 🔧' : '') +
24-
(docs.replacedBy
25-
? ' (use [`' +
26-
pluginName +
27-
'/' +
28-
docs.replacedBy +
29-
'`](' +
30-
docPath.replace('{name}', docs.replacedBy) +
31-
'))'
32-
: '') +
33-
(ruleData.configMap.size
34-
? ' ' +
35-
Array.from(ruleData.configMap.keys())
36-
.map((name) => {
37-
const options = ruleData.configMap.get(name)
38-
return '`' + name + (options && Object.keys(options[0]).length ? '†' : '') + '`'
39-
})
40-
.join(', ')
41-
: '')
42-
)
43-
}
44-
return null
45-
})
46-
.filter((rule) => rule)
47-
.join('\n')
10+
const thead = '| Rule | `recommended` | \n | --- | --- | \n'
11+
12+
return (
13+
thead +
14+
Array.from(rulesWithConfig.keys())
15+
.map((rule) => {
16+
const fullRule = pluginName + '/' + rule
17+
const ruleData = rulesWithConfig.get(rule)
18+
19+
const docs = ruleData.meta.docs
20+
if (!!docs.deprecated === deprecated) {
21+
return (
22+
'|' +
23+
'[`' +
24+
fullRule +
25+
'`](' +
26+
docPath.replace('{name}', rule) +
27+
')' +
28+
(ruleData.meta.schema.length ? ' ⚙️' : '') +
29+
(ruleData.meta.fixable ? ' 🔧' : '') +
30+
(docs.replacedBy
31+
? ' (use [`' +
32+
pluginName +
33+
'/' +
34+
docs.replacedBy +
35+
'`](' +
36+
docPath.replace('{name}', docs.replacedBy) +
37+
'))'
38+
: '') +
39+
'|' +
40+
(ruleData.configMap.has('recommended') ? '✔️' : '') +
41+
'|'
42+
)
43+
}
44+
return null
45+
})
46+
.filter((rule) => rule)
47+
.join('\n')
48+
)
4849
}
4950

5051
fs.writeFile(

0 commit comments

Comments
 (0)