Skip to content

Commit abb60c9

Browse files
committed
docs: add documentation site with Docus and Cloudflare Pages
Set up docs/ directory with Docus (Nuxt-based documentation theme) covering eslint-config, prettier-config, and editorconfig packages. Configured for Cloudflare Pages static deployment via wrangler.
1 parent dbe5fd7 commit abb60c9

13 files changed

Lines changed: 3570 additions & 28 deletions

File tree

bun.lock

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Nuxt
2+
.nuxt/
3+
.output/
4+
.data/
5+
dist/
6+
7+
# Node
8+
node_modules/
9+
10+
# Cloudflare
11+
.wrangler/
12+
13+
# Misc
14+
.DS_Store
15+
*.log

docs/app/app.config.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default defineAppConfig({
2+
docus: {
3+
locale: 'en',
4+
},
5+
seo: {
6+
title: 'PleaseAI Code Style',
7+
description: 'Shared code style configurations for PleaseAI projects',
8+
titleTemplate: '%s - PleaseAI Code Style',
9+
},
10+
header: {
11+
title: 'PleaseAI Code Style',
12+
},
13+
toc: {
14+
title: 'On this page',
15+
},
16+
github: {
17+
url: 'https://github.com/pleaseai/code-style',
18+
branch: 'main',
19+
rootDir: 'docs',
20+
},
21+
})

docs/bun.lock

Lines changed: 3188 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
title: ESLint Config
3+
description: Opinionated ESLint flat config for PleaseAI projects.
4+
navigation:
5+
icon: i-lucide-shield-check
6+
---
7+
8+
# ESLint Config
9+
10+
`@pleaseai/eslint-config` is an opinionated ESLint flat config built on top of [`@antfu/eslint-config`](https://github.com/antfu/eslint-config).
11+
12+
## Features
13+
14+
- ESLint flat config format
15+
- Single quotes, no semicolons, 2-space indent
16+
- TypeScript support out of the box
17+
- Auto-detects `.gitignore` patterns
18+
- Re-exports all `@antfu/eslint-config` utilities
19+
20+
## Installation
21+
22+
:::code-group
23+
```bash [bun]
24+
bun add -D @pleaseai/eslint-config eslint
25+
```
26+
27+
```bash [pnpm]
28+
pnpm add -D @pleaseai/eslint-config eslint
29+
```
30+
31+
```bash [npm]
32+
npm install -D @pleaseai/eslint-config eslint
33+
```
34+
:::
35+
36+
## Usage
37+
38+
Create an `eslint.config.ts` (or `eslint.config.mjs`) in your project root:
39+
40+
```ts [eslint.config.ts]
41+
import pleaseai from '@pleaseai/eslint-config'
42+
43+
export default pleaseai()
44+
```
45+
46+
### With Options
47+
48+
The `pleaseai()` function accepts the same options as `@antfu/eslint-config`:
49+
50+
```ts [eslint.config.ts]
51+
import pleaseai from '@pleaseai/eslint-config'
52+
53+
export default pleaseai({
54+
vue: true,
55+
react: true,
56+
// Override any @antfu/eslint-config option
57+
})
58+
```
59+
60+
### With Additional Configs
61+
62+
You can pass additional flat config items as rest arguments:
63+
64+
```ts [eslint.config.ts]
65+
import pleaseai from '@pleaseai/eslint-config'
66+
67+
export default pleaseai(
68+
{
69+
typescript: true,
70+
},
71+
{
72+
rules: {
73+
'no-console': 'warn',
74+
},
75+
},
76+
)
77+
```
78+
79+
## Defaults
80+
81+
| Option | Value |
82+
|--------|-------|
83+
| `indent` | `2` (spaces) |
84+
| `quotes` | `single` |
85+
| `semi` | `false` |
86+
| `typescript` | `true` |
87+
| `gitignore` | `true` |
88+
89+
## VS Code Integration
90+
91+
Install the [ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and add to your `.vscode/settings.json`:
92+
93+
```json [.vscode/settings.json]
94+
{
95+
"eslint.format.enable": true,
96+
"editor.codeActionsOnSave": {
97+
"source.fixAll.eslint": "explicit"
98+
}
99+
}
100+
```
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Package JSON Lint
3+
description: Lint package.json files with ESLint.
4+
---
5+
6+
# Package JSON Lint
7+
8+
`@pleaseai/eslint-config` also exports configs from [`eslint-plugin-package-json`](https://github.com/JoshuaKGoldberg/eslint-plugin-package-json) for linting `package.json` files.
9+
10+
## Usage
11+
12+
```ts [eslint.config.ts]
13+
import { recommended, stylistic } from '@pleaseai/eslint-config/package-json'
14+
15+
export default [
16+
recommended,
17+
stylistic,
18+
]
19+
```
20+
21+
### Available Configs
22+
23+
| Export | Description |
24+
|--------|-------------|
25+
| `recommended` | Recommended rules for publishable packages |
26+
| `stylistic` | Stylistic rules for consistent `package.json` formatting |
27+
28+
### Combined with ESLint Config
29+
30+
```ts [eslint.config.ts]
31+
import pleaseai from '@pleaseai/eslint-config'
32+
import { recommended } from '@pleaseai/eslint-config/package-json'
33+
34+
export default pleaseai(
35+
{},
36+
recommended,
37+
)
38+
```

docs/content/2.prettier-config.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Prettier Config
3+
description: Shared Prettier configuration for PleaseAI projects.
4+
navigation:
5+
icon: i-lucide-paintbrush
6+
---
7+
8+
# Prettier Config
9+
10+
`@pleaseai/prettier-config` provides a shared Prettier configuration for consistent formatting across PleaseAI projects.
11+
12+
## Installation
13+
14+
:::code-group
15+
```bash [bun]
16+
bun add -D @pleaseai/prettier-config prettier
17+
```
18+
19+
```bash [pnpm]
20+
pnpm add -D @pleaseai/prettier-config prettier
21+
```
22+
23+
```bash [npm]
24+
npm install -D @pleaseai/prettier-config prettier
25+
```
26+
:::
27+
28+
## Usage
29+
30+
Reference it in your `package.json`:
31+
32+
```json [package.json]
33+
{
34+
"prettier": "@pleaseai/prettier-config"
35+
}
36+
```
37+
38+
Or create a `.prettierrc.json`:
39+
40+
```json [.prettierrc.json]
41+
"@pleaseai/prettier-config"
42+
```
43+
44+
### Extending
45+
46+
To override specific options, create a `.prettierrc.mjs`:
47+
48+
```js [.prettierrc.mjs]
49+
import config from '@pleaseai/prettier-config'
50+
51+
export default {
52+
...config,
53+
printWidth: 100,
54+
}
55+
```
56+
57+
## Configuration
58+
59+
| Option | Value |
60+
|--------|-------|
61+
| `singleQuote` | `true` |
62+
| `semi` | `false` |
63+
| `useTabs` | `false` |
64+
| `tabWidth` | `2` |
65+
| `endOfLine` | `auto` |
66+
| `bracketSpacing` | `false` |
67+
| `arrowParens` | `always` |
68+
| `bracketSameLine` | `false` |
69+
| `printWidth` | `120` |
70+
| `trailingComma` | `all` |
71+
72+
## Compatibility
73+
74+
- Prettier `^2.8.8` or `^3.0.0`

docs/content/3.editorconfig.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: EditorConfig
3+
description: Shared EditorConfig for consistent editor settings.
4+
navigation:
5+
icon: i-lucide-file-cog
6+
---
7+
8+
# EditorConfig
9+
10+
`@pleaseai/editorconfig` provides a shared `.editorconfig` file for consistent editor settings across PleaseAI projects.
11+
12+
## What is EditorConfig?
13+
14+
[EditorConfig](https://editorconfig.org/) helps maintain consistent coding styles across different editors and IDEs. Most modern editors support it natively or via plugins.
15+
16+
## Usage
17+
18+
Copy the `.editorconfig` file from this package to your project root, or reference the package in your project setup scripts.
19+
20+
## Supported Editors
21+
22+
- VS Code (built-in or via [EditorConfig extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig))
23+
- JetBrains IDEs (built-in)
24+
- Vim/Neovim (via plugin)
25+
- Sublime Text (via plugin)

docs/content/index.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: PleaseAI Code Style
3+
description: Shared code style configurations for PleaseAI projects.
4+
navigation: false
5+
---
6+
7+
# PleaseAI Code Style
8+
9+
Shared ESLint, Prettier, and EditorConfig configurations for consistent code style across PleaseAI projects.
10+
11+
## Packages
12+
13+
::card-group
14+
::card{title="ESLint Config" icon="i-lucide-shield-check" to="/eslint-config"}
15+
Opinionated ESLint flat config built on top of `@antfu/eslint-config`.
16+
::
17+
18+
::card{title="Prettier Config" icon="i-lucide-paintbrush" to="/prettier-config"}
19+
Shared Prettier configuration for consistent formatting.
20+
::
21+
22+
::card{title="EditorConfig" icon="i-lucide-file-cog" to="/editorconfig"}
23+
Shared `.editorconfig` for consistent editor settings.
24+
::
25+
::
26+
27+
## Quick Start
28+
29+
:::code-group
30+
```bash [bun]
31+
bun add -D @pleaseai/eslint-config eslint
32+
```
33+
34+
```bash [pnpm]
35+
pnpm add -D @pleaseai/eslint-config eslint
36+
```
37+
38+
```bash [npm]
39+
npm install -D @pleaseai/eslint-config eslint
40+
```
41+
:::
42+
43+
```ts [eslint.config.ts]
44+
import pleaseai from '@pleaseai/eslint-config'
45+
46+
export default pleaseai()
47+
```

docs/nuxt.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default defineNuxtConfig({
2+
extends: ['docus'],
3+
})

0 commit comments

Comments
 (0)