Skip to content

Commit 915b5f4

Browse files
committed
refactor(ui/prettier): add prettier code formatter
1 parent 16527ec commit 915b5f4

File tree

270 files changed

+4626
-5716
lines changed

Some content is hidden

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

270 files changed

+4626
-5716
lines changed

.circleci/conditional_config.yml

+36-36
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ executors:
1010
- image: cimg/base:stable
1111
node:
1212
docker:
13-
- image: 'cimg/node:20.12.1'
13+
- image: "cimg/node:20.12.1"
1414
go:
1515
docker:
1616
- image: cimg/go:1.22.1
@@ -26,43 +26,43 @@ parameters:
2626
jobs:
2727
## Backend
2828
test_app:
29-
executor: go
30-
working_directory: ~/go/src/github.com/ArtalkJS/Artalk
31-
environment:
32-
GO111MODULE: "on"
33-
steps:
34-
- checkout
35-
- run:
36-
name: "Print the Go version"
37-
command: >
38-
go version
39-
- restore_cache:
40-
keys:
41-
- go-mod-1.22.1-{{ checksum "go.sum" }}
42-
- run:
43-
name: Install Dependencies
44-
command: go mod download
45-
- save_cache:
46-
key: go-mod-1.22.1-{{ checksum "go.sum" }}
47-
paths:
48-
- "~/go/pkg/mod"
49-
- run:
50-
name: Run tests
51-
command: |
52-
mkdir -p /tmp/test-reports
53-
gotestsum --junitfile /tmp/test-reports/unit-tests.xml -- -coverprofile=/tmp/test-reports/coverage.out ./...
54-
- store_test_results:
55-
path: /tmp/test-reports
56-
- codecov/upload:
57-
flags: go
58-
file: /tmp/test-reports/coverage.out
29+
executor: go
30+
working_directory: ~/go/src/github.com/ArtalkJS/Artalk
31+
environment:
32+
GO111MODULE: "on"
33+
steps:
34+
- checkout
35+
- run:
36+
name: "Print the Go version"
37+
command: >
38+
go version
39+
- restore_cache:
40+
keys:
41+
- go-mod-1.22.1-{{ checksum "go.sum" }}
42+
- run:
43+
name: Install Dependencies
44+
command: go mod download
45+
- save_cache:
46+
key: go-mod-1.22.1-{{ checksum "go.sum" }}
47+
paths:
48+
- "~/go/pkg/mod"
49+
- run:
50+
name: Run tests
51+
command: |
52+
mkdir -p /tmp/test-reports
53+
gotestsum --junitfile /tmp/test-reports/unit-tests.xml -- -coverprofile=/tmp/test-reports/coverage.out ./...
54+
- store_test_results:
55+
path: /tmp/test-reports
56+
- codecov/upload:
57+
flags: go
58+
file: /tmp/test-reports/coverage.out
5959

6060
all_projects:
61-
executor: base
62-
steps:
63-
- run:
64-
command: |
65-
echo "all"
61+
executor: base
62+
steps:
63+
- run:
64+
command: |
65+
echo "all"
6666
6767
workflows:
6868
build-app:

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ workflows:
1717
mapping: |
1818
(cmd|internal|server|pkg|test|conf)/.* trigger-app true
1919
main.go|go.mod|go.sum trigger-app true
20-
base-revision: master # git branch name
20+
base-revision: master # git branch name
2121
config-path: .circleci/conditional_config.yml
2222
filters:
2323
branches:

.eslintrc.cjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ module.exports = {
4040
settings: {
4141
'import/resolver': {
4242
typescript: {
43-
project: ['ui/artalk/tsconfig.json'].map((p) =>
44-
path.resolve(__dirname, p),
45-
),
43+
project: ['ui/artalk/tsconfig.json'].map((p) => path.resolve(__dirname, p)),
4644
},
4745
},
4846
polyfills: ['AbortController'],

.github/chglog/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ info:
44
title: CHANGELOG
55
repository_url: https://github.com/ArtalkJS/Artalk
66
options:
7-
tag_filter_pattern: '^v'
8-
sort: "date"
7+
tag_filter_pattern: "^v"
8+
sort: date
99
commits:
1010
filters:
1111
Type:

.github/dependabot.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ updates:
1414
groups:
1515
deps:
1616
patterns:
17-
- '*'
17+
- "*"
1818
open-pull-requests-limit: 15
1919

2020
- package-ecosystem: npm
@@ -39,7 +39,7 @@ updates:
3939
groups:
4040
deps:
4141
patterns:
42-
- '*'
42+
- "*"
4343
open-pull-requests-limit: 15
4444

4545
- package-ecosystem: docker
@@ -51,7 +51,7 @@ updates:
5151
groups:
5252
deps:
5353
patterns:
54-
- '*'
54+
- "*"
5555
open-pull-requests-limit: 15
5656

5757
- package-ecosystem: github-actions
@@ -63,5 +63,5 @@ updates:
6363
groups:
6464
deps:
6565
patterns:
66-
- '*'
66+
- "*"
6767
open-pull-requests-limit: 15

.github/workflows/build-app.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151

5252
- name: Setup git-chglog
5353
run: |
54-
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
55-
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
56-
git-chglog --version
54+
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
55+
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
56+
git-chglog --version
5757
5858
- name: Pre Build
5959
run: |-

.github/workflows/build-nightly.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ run-name: Build Nightly
33

44
on:
55
schedule:
6-
- cron: '0 10 * * *'
6+
- cron: "0 10 * * *"
77
workflow_dispatch:
88
inputs:
99
dry_run:
10-
description: 'Dry run'
10+
description: "Dry run"
1111
type: boolean
1212
default: true
1313

@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
node-version: 20.x
6161
registry-url: https://registry.npmjs.org/
62-
cache: 'pnpm'
62+
cache: "pnpm"
6363

6464
- name: Get pnpm store directory
6565
shell: bash

.github/workflows/build-tagging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
type: number
1212
outputs:
1313
version:
14-
description: 'Version'
14+
description: "Version"
1515
value: ${{ jobs.tagging.outputs.version }}
1616

1717
jobs:

.github/workflows/build-ui.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
with:
3131
node-version: 20.x
3232
registry-url: https://registry.npmjs.org/
33-
cache: 'pnpm'
33+
cache: "pnpm"
3434

3535
- name: Install dependencies
3636
run: pnpm install --frozen-lockfile

.github/workflows/build.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ on:
99
workflow_dispatch:
1010
inputs:
1111
dry_run:
12-
description: 'Dry run'
12+
description: "Dry run"
1313
type: boolean
1414
default: true
1515
build_items:
16-
description: 'Build items'
16+
description: "Build items"
1717
type: string
18-
default: 'ui,app,docker'
18+
default: "ui,app,docker"
1919

2020
jobs:
2121
# Tag the release version code before building
@@ -54,7 +54,11 @@ jobs:
5454
# since docker push actions will override the previous images,
5555
# so need to build `linux/amd64` and push first,
5656
# then build `linux/amd64` twice with other archs (build very slow so keep it last).
57-
target: ["linux/amd64", "linux/amd64,linux/arm64,linux/arm/v7"]
57+
target:
58+
- linux/amd64
59+
- linux/amd64
60+
- linux/arm64
61+
- linux/arm/v7
5862
with:
5963
version: ${{ needs.tagging.outputs.version }}
6064
dry_run: ${{ inputs.dry_run || false }}

.github/workflows/codeql.yml

+36-33
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: CodeQL
1313

1414
on:
1515
push:
16-
branches: [ "master" ]
16+
branches:
17+
- master
1718
pull_request:
1819
# The branches below must be a subset of the branches above
19-
branches: [ "master" ]
20+
branches:
21+
- master
2022
schedule:
21-
- cron: '40 17 * * 4'
23+
- cron: "40 17 * * 4"
2224

2325
jobs:
2426
analyze:
@@ -32,43 +34,44 @@ jobs:
3234
strategy:
3335
fail-fast: false
3436
matrix:
35-
language: [ 'go', 'javascript' ]
37+
language:
38+
- go
39+
- javascript
3640
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3741
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3842

3943
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v4
44+
- name: Checkout repository
45+
uses: actions/checkout@v4
4246

43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
47+
# Initializes the CodeQL tools for scanning.
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v3
50+
with:
51+
languages: ${{ matrix.language }}
52+
# If you wish to specify custom queries, you can do so here or in a config file.
53+
# By default, queries listed here will override any specified in a config file.
54+
# Prefix the list here with "+" to use these queries and those in the config file.
5155

52-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
53-
# queries: security-extended,security-and-quality
56+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
57+
# queries: security-extended,security-and-quality
5458

59+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
60+
# If this step fails, then you should remove it and run the build manually (see below)
61+
- name: Autobuild
62+
uses: github/codeql-action/autobuild@v3
5563

56-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57-
# If this step fails, then you should remove it and run the build manually (see below)
58-
- name: Autobuild
59-
uses: github/codeql-action/autobuild@v3
64+
# ℹ️ Command-line programs to run using the OS shell.
65+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
6066

61-
# ℹ️ Command-line programs to run using the OS shell.
62-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
67+
# If the Autobuild fails above, remove it and uncomment the following three lines.
68+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
6369

64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
65-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
70+
# - run: |
71+
# echo "Run, Build Application using script"
72+
# ./location_of_script_within_repo/buildscript.sh
6673

67-
# - run: |
68-
# echo "Run, Build Application using script"
69-
# ./location_of_script_within_repo/buildscript.sh
70-
71-
- name: Perform CodeQL Analysis
72-
uses: github/codeql-action/analyze@v3
73-
with:
74-
category: "/language:${{matrix.language}}"
74+
- name: Perform CodeQL Analysis
75+
uses: github/codeql-action/analyze@v3
76+
with:
77+
category: "/language:${{matrix.language}}"

.github/workflows/docs-cn.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Docs CN Mirror Deploy
22

33
on:
44
push:
5-
branches: ['master']
6-
paths: ['docs/**']
5+
branches: ["master"]
6+
paths: ["docs/**"]
77

88
jobs:
99
deploy:
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: 20
23-
cache: "pnpm"
23+
cache: pnpm
2424

2525
- name: Install dependencies
2626
run: pnpm install

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- major
1414
required: true
1515
dry_run:
16-
description: 'Dry run?'
16+
description: "Dry run?"
1717
type: boolean
1818
default: false
1919

@@ -49,9 +49,9 @@ jobs:
4949

5050
- name: Setup git-chglog
5151
run: |
52-
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
53-
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
54-
git-chglog --version
52+
curl -sL $(curl -s https://api.github.com/repos/git-chglog/git-chglog/releases/latest \
53+
| grep -oP '"https://.+linux_amd64.tar.gz"' | tr -d \") | tar -C /usr/local/bin -xz git-chglog
54+
git-chglog --version
5555
5656
- name: Version Changelog
5757
run: |

.github/workflows/repo-dispatch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
type: string
99
description: Event Type
1010
required: true
11-
default: ''
11+
default: ""
1212

1313
jobs:
1414
release:

0 commit comments

Comments
 (0)