Skip to content

Commit 4f0616a

Browse files
Add ESLint and Prettier with consistent formatting standards
- Add ESLint 9 and Prettier for consistent code formatting across docs repos - Configure ESLint with TypeScript and Astro support - Standardize lint and format commands across all repositories - Upgrade to ESLint 9 flat config format (eslint.config.js) - Update all ESLint and Prettier packages to latest versions - Add CI checks to enforce formatting standards
1 parent 77a0c2a commit 4f0616a

File tree

5 files changed

+2663
-212
lines changed

5 files changed

+2663
-212
lines changed

packages/documentation/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ $ pnpm build:docs
3030

3131
This command generates static content into the build directory and can be served using any static contents hosting service.
3232

33+
- Format code and fix linting issues:
34+
35+
```sh
36+
$ pnpm format
37+
```
38+
39+
- Check formatting and linting:
40+
41+
```sh
42+
$ pnpm lint
43+
```
44+
3345
## Editing Content
3446

3547
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. Due to the nature of how Starlight deals with content and their generated URLs, all docs content lives in `/src/content/docs/`. For example, the home page of the documentation lives within the `/src/content/docs/` folder and is rendered at rafiki.dev, not rafiki.dev/docs.
@@ -112,3 +124,12 @@ import Base from '../layouts/Base.astro';
112124
```
113125

114126
Refer to the Astro documentation on [pages](https://docs.astro.build/en/core-concepts/astro-pages/) for more detailed guidance.
127+
128+
## Code Formatting
129+
130+
This project uses [Prettier](https://prettier.io/) and [ESLint](https://eslint.org/) for code formatting and linting. Before submitting a pull request, please ensure your code is properly formatted:
131+
132+
1. **Fix issues**: Run `pnpm format` to automatically fix formatting and linting issues
133+
2. **Check before pushing**: Run `pnpm lint` to verify everything passes (CI will also run this)
134+
135+
ESLint is configured to work with TypeScript and Astro files. The configuration extends recommended rules from ESLint, TypeScript ESLint, and Astro ESLint plugins.

0 commit comments

Comments
 (0)