Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit e932875

Browse files
committed
Reformat with Prettier
1 parent 714ba28 commit e932875

19 files changed

+675
-248
lines changed

.eslintignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
src/luogu-api-docs/
1+
node_modules/
2+
coverage/
23
dist/
3-
venv/
4+
!.*rc.js
5+
!.*rc.mjs
6+
!.*rc.cjs
7+
src/luogu-api-docs/

.eslintrc.cjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
env: {
3+
es2021: true,
4+
node: true,
5+
},
6+
extends: ["eslint:recommended", "airbnb-base", "plugin:prettier/recommended"],
7+
parserOptions: {
8+
ecmaVersion: "latest",
9+
sourceType: "module",
10+
},
11+
overrides: [
12+
{
13+
files: ["*.ts", "*.tsx"],
14+
extends: [
15+
"eslint:recommended",
16+
"airbnb-base",
17+
"airbnb-typescript/base",
18+
"plugin:@typescript-eslint/recommended",
19+
"plugin:prettier/recommended",
20+
],
21+
parser: "@typescript-eslint/parser",
22+
parserOptions: {
23+
project: "./tsconfig.eslint.json",
24+
},
25+
rules: {
26+
quotes: [
27+
"error",
28+
"double",
29+
{ avoidEscape: true, allowTemplateLiterals: false },
30+
],
31+
},
32+
},
33+
{
34+
files: ["*.config.*", ".*rc.*"],
35+
rules: {
36+
"import/no-extraneous-dependencies": [
37+
"error",
38+
{ devDependencies: true },
39+
],
40+
},
41+
},
42+
],
43+
};

.eslintrc.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/node.js.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
43
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
54

@@ -9,7 +8,6 @@ on: [push, pull_request]
98

109
jobs:
1110
build:
12-
1311
runs-on: ubuntu-latest
1412

1513
# Service containers to run with `container-job`
@@ -46,7 +44,7 @@ jobs:
4644
uses: actions/setup-node@v3
4745
with:
4846
node-version: ${{ matrix.node-version }}
49-
cache: 'pnpm'
47+
cache: "pnpm"
5048
- name: Install dependencies
5149
run: |
5250
pnpm install

.github/workflows/python-app.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
43
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
54

@@ -9,7 +8,6 @@ on: [push, pull_request]
98

109
jobs:
1110
build:
12-
1311
runs-on: ubuntu-latest
1412
strategy:
1513
fail-fast: false

.husky/pre-commit

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
33

4-
pnpm run lint
4+
pnpm exec lint-staged

.lintstagedrc.cjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const eslint = "eslint --fix";
2+
const prettier = "prettier --write";
3+
4+
module.exports = {
5+
"*.{js,mjs,cjs,jsx,ts,tsx,vue}": [prettier, eslint],
6+
"*.{md,css,scss,json,yml,yaml,graphql}": [prettier],
7+
};

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pnpm-lock.yaml
2+
tsconfig.json
3+
coverage/
4+
src/luogu-api-docs/

README.md

Lines changed: 51 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Host: exlg.piterator.com
3030

3131
```json
3232
{
33-
"status": 200,
34-
"data": "0123456789abcdef0123456789abcdef"
33+
"status": 200,
34+
"data": "0123456789abcdef0123456789abcdef"
3535
}
3636
```
3737

@@ -53,25 +53,25 @@ Content-Type: application/json
5353

5454
```json
5555
{
56-
"status": 200,
57-
"data": {
58-
"uid": 108135,
59-
"token": "0123456789abcdef0123456789abcdef"
60-
}
56+
"status": 200,
57+
"data": {
58+
"uid": 108135,
59+
"token": "0123456789abcdef0123456789abcdef"
60+
}
6161
}
6262
```
6363

6464
```json
6565
{
66-
"status": 401,
67-
"error": "剪贴板内容未找到"
66+
"status": 401,
67+
"error": "剪贴板内容未找到"
6868
}
6969
```
7070

7171
```json
7272
{
73-
"status": 403,
74-
"error": "Invalid paste content: "
73+
"status": 403,
74+
"error": "Invalid paste content: "
7575
}
7676
```
7777

@@ -89,8 +89,8 @@ Content-Type: application/json
8989

9090
```json
9191
{
92-
"uid": 108135,
93-
"token": "0123456789abcdef0123456789abcdef"
92+
"uid": 108135,
93+
"token": "0123456789abcdef0123456789abcdef"
9494
}
9595
```
9696

@@ -100,17 +100,17 @@ Content-Type: application/json
100100

101101
```json
102102
{
103-
"status": 200,
104-
"data": 259199
103+
"status": 200,
104+
"data": 259199
105105
}
106106
```
107107

108108
响应 HTTP 状态码为 `401 Unauthorized` 时,`data` 为一个包含错误信息的 JSON 对象
109109

110110
```json
111111
{
112-
"status": 401,
113-
"error": "Authentication failed"
112+
"status": 401,
113+
"error": "Authentication failed"
114114
}
115115
```
116116

@@ -131,13 +131,9 @@ Content-Type: application/json
131131

132132
```json
133133
{
134-
"uid": "108135",
135-
"token": "a",
136-
"data": [
137-
"",
138-
108135,
139-
"224978"
140-
]
134+
"uid": "108135",
135+
"token": "a",
136+
"data": ["", 108135, "224978"]
141137
}
142138
```
143139

@@ -147,20 +143,20 @@ Content-Type: application/json
147143

148144
```json
149145
{
150-
"status": 200,
151-
"data": {
152-
"": {},
153-
"108135": {
154-
"text": "wxh",
155-
"bg": "",
156-
"fg": ""
157-
},
158-
"224978": {
159-
"text": "o2",
160-
"bg": "",
161-
"fg": ""
162-
}
146+
"status": 200,
147+
"data": {
148+
"": {},
149+
"108135": {
150+
"text": "wxh",
151+
"bg": "",
152+
"fg": ""
153+
},
154+
"224978": {
155+
"text": "o2",
156+
"bg": "",
157+
"fg": ""
163158
}
159+
}
164160
}
165161
```
166162

@@ -180,23 +176,23 @@ Content-Type: application/j son
180176

181177
```json
182178
{
183-
"uid": 108135,
184-
"token": "0123456789abcdef0123456789abcdef",
185-
"activation": "<exlgactivationkey>",
186-
"data": {
187-
"text": "wxh",
188-
"bg": ""
189-
}
179+
"uid": 108135,
180+
"token": "0123456789abcdef0123456789abcdef",
181+
"activation": "<exlgactivationkey>",
182+
"data": {
183+
"text": "wxh",
184+
"bg": ""
185+
}
190186
}
191187
```
192188

193189
```json
194190
{
195-
"uid": 108135,
196-
"token": "0123456789abcdef0123456789abcdef",
197-
"data": {
198-
"text": "wxh"
199-
}
191+
"uid": 108135,
192+
"token": "0123456789abcdef0123456789abcdef",
193+
"data": {
194+
"text": "wxh"
195+
}
200196
}
201197
```
202198

@@ -206,12 +202,12 @@ Content-Type: application/j son
206202

207203
```json
208204
{
209-
"status": 200,
210-
"data": {
211-
"108135": {
212-
"text": "wxh",
213-
"bg": ""
214-
}
205+
"status": 200,
206+
"data": {
207+
"108135": {
208+
"text": "wxh",
209+
"bg": ""
215210
}
211+
}
216212
}
217213
```

0 commit comments

Comments
 (0)