Skip to content

Commit 9d089d0

Browse files
Add Prettier and ESLint configuration files, update package dependencies, and set up CI workflow
- Introduced `.prettierrc` and `.prettierignore` for consistent code formatting. - Added `eslint.config.js` for TypeScript linting with custom rules. - Updated `package.json` and `package-lock.json` to include new dependencies for ESLint and Prettier. - Created a CI workflow in `.github/workflows/ci.yml` to automate linting, formatting checks, testing, and building. - Enhanced scripts in `package.json` for testing and formatting tasks.
1 parent 96780bd commit 9d089d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+7068
-1210
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ci:
11+
name: Lint, Format, Test & Build
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: npm
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Lint
28+
run: npm run lint
29+
30+
- name: Check formatting
31+
run: npm run format:check
32+
33+
- name: Run tests
34+
run: npm test
35+
36+
- name: Build
37+
run: npm run build

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"trailingComma": "es5",
5+
"printWidth": 100,
6+
"tabWidth": 2
7+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ This runs Vite in watch mode, rebuilding on file changes.
7070
## Configuration
7171

7272
Default relays:
73+
7374
- `https://pkarr.pubky.app`
7475
- `https://pkarr.pubky.org`
7576

eslint.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import eslint from "@eslint/js";
2+
import tseslint from "typescript-eslint";
3+
4+
export default tseslint.config(
5+
eslint.configs.recommended,
6+
...tseslint.configs.recommended,
7+
{
8+
ignores: ["dist/**", "node_modules/**", "scripts/**", "update-locales.js"],
9+
},
10+
{
11+
rules: {
12+
"@typescript-eslint/no-unused-vars": [
13+
"error",
14+
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
15+
],
16+
},
17+
}
18+
);

0 commit comments

Comments
 (0)