Skip to content

Commit ca338be

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 89d4662 commit ca338be

File tree

6 files changed

+1533
-1
lines changed

6 files changed

+1533
-1
lines changed

.github/pull_request_template.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Changes proposed in this pull request
2+
3+
<!--
4+
Provide a succinct description of what this pull request entails.
5+
-->
6+
7+
## Context
8+
9+
<!--
10+
What were you trying to do?
11+
Link issues here - using `fixes #number`
12+
-->
13+
14+
## Checklist
15+
16+
- [ ] I have run `bun run format` to ensure code is properly formatted
17+
- [ ] I have verified that `bun run lint` passes without errors
18+
19+

.github/workflows/test-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ jobs:
1717

1818
- name: Install dependencies
1919
run: bun install
20+
- name: Run ESLint
21+
run: bun run lint
2022
- name: Test build website
2123
run: bun run build

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,20 @@ All commands are run from the root of the project, from a terminal:
5252
| `bun run preview` | Preview your build locally, before deploying |
5353
| `bun run astro ...` | Run CLI commands like `astro add`, `astro check` |
5454
| `bun run astro -- --help` | Get help using the Astro CLI |
55+
| `bun run format` | Fix linting issues |
56+
| `bun run lint` | Check linting |
5557

5658
You can substitute the `bun` commands with whatever package manager of your choice uses.
5759

60+
### 🔍 Code Linting
61+
62+
This project uses [ESLint](https://eslint.org/) for code linting. Before submitting a pull request, please ensure your code passes linting:
63+
64+
1. **Fix issues**: Run `bun run format` to automatically fix linting issues
65+
2. **Check before pushing**: Run `bun run lint` to verify everything passes (CI will also run this)
66+
67+
ESLint is configured to work with TypeScript and Astro files. The configuration extends recommended rules from ESLint, TypeScript ESLint, and Astro ESLint plugins.
68+
5869
### 👀 Want to learn more?
5970

6071
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat).

0 commit comments

Comments
 (0)