Skip to content

Commit 70746be

Browse files
[Code Style] add eslint + prettier (#21)
* install prettier and eslint * apply fixes
1 parent d87abd1 commit 70746be

15 files changed

+1016
-71
lines changed

.eslintrc.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 2022,
6+
"sourceType": "module",
7+
"project": true
8+
},
9+
"plugins": ["@typescript-eslint", "playwright"],
10+
"extends": [
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:playwright/recommended",
14+
"prettier"
15+
],
16+
"rules": {
17+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
18+
"@typescript-eslint/explicit-function-return-type": "off",
19+
"@typescript-eslint/no-explicit-any": "warn"
20+
},
21+
"env": {
22+
"node": true,
23+
"es2022": true
24+
},
25+
"ignorePatterns": ["node_modules/", "test-results/", "playwright-report/", "*.config.ts"]
26+
}

.github/actions/setup-playwright/action.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ runs:
99
with:
1010
node-version: '22'
1111
cache: 'yarn'
12-
12+
1313
- name: Install dependencies
1414
run: yarn install
1515
shell: bash
16-
16+
1717
- name: Cache Playwright browsers
1818
id: cache-playwright
1919
uses: actions/cache@v4
@@ -23,8 +23,8 @@ runs:
2323
restore-keys: |
2424
playwright-browsers-${{ runner.os }}-
2525
save-always: true
26-
26+
2727
- name: Install Playwright browsers
2828
if: steps.cache-playwright.outputs.cache-hit != 'true'
2929
run: yarn playwright install --with-deps
30-
shell: bash
30+
shell: bash

.github/workflows/auto-simple-suite-reusable.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Auto run simple suite with reusable setup
22

33
on:
4-
pull_request:
5-
branches: [ main ]
4+
pull_request:
5+
branches: [main]
66
workflow_dispatch:
77

88
jobs:
@@ -41,4 +41,4 @@ jobs:
4141
with:
4242
job_status: ${{ needs.run-simple-suite.result }}
4343
secrets:
44-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
44+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/auto-simple-suite.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Auto run simple suite
22

33
on:
4-
pull_request:
5-
branches: [ main ]
4+
pull_request:
5+
branches: [main]
66
workflow_dispatch:
77

88
jobs:
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
steps:
4242
- name: Post a start message in a Slack channel
43-
env:
43+
env:
4444
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
4545
run: |
4646
curl -X POST -H 'Content-type: application/json' \
@@ -49,19 +49,19 @@ jobs:
4949
5050
post-slack-notification-results:
5151
runs-on: ubuntu-latest
52-
needs: run-simple-suite
52+
needs: run-simple-suite
5353
if: always()
5454
steps:
5555
- name: Post a result message in a Slack channel
56-
env:
56+
env:
5757
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
5858
run: |
5959
if [ "${{ needs.run-simple-suite.result }}" == "success" ]; then
6060
MESSAGE="The simple suite pipeline succeeded"
6161
elif [ "${{ needs.run-simple-suite.result }}" == "failure" ]; then
6262
MESSAGE="The simple suite pipeline failed"
6363
fi
64-
64+
6565
curl -X POST -H 'Content-type: application/json' \
6666
--data "{\"text\":\"$MESSAGE\"}" \
67-
$SLACK_WEBHOOK_URL
67+
$SLACK_WEBHOOK_URL

.github/workflows/playwright.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
name: Playwright Tests
22
on:
33
push:
4-
branches: [ main, master ]
4+
branches: [main, master]
55
pull_request:
6-
branches: [ main, master ]
6+
branches: [main, master]
77
jobs:
88
test:
99
timeout-minutes: 60
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-node@v4
14-
with:
15-
node-version: lts/*
16-
- name: Install dependencies
17-
run: npm install -g yarn && yarn
18-
- name: Install Playwright Browsers
19-
run: yarn playwright install --with-deps
20-
- name: Run Playwright tests
21-
run: yarn playwright test
22-
- uses: actions/upload-artifact@v4
23-
if: ${{ !cancelled() }}
24-
with:
25-
name: playwright-report
26-
path: playwright-report/
27-
retention-days: 30
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: lts/*
16+
- name: Install dependencies
17+
run: npm install -g yarn && yarn
18+
- name: Install Playwright Browsers
19+
run: yarn playwright install --with-deps
20+
- name: Run Playwright tests
21+
run: yarn playwright test
22+
- uses: actions/upload-artifact@v4
23+
if: ${{ !cancelled() }}
24+
with:
25+
name: playwright-report
26+
path: playwright-report/
27+
retention-days: 30

.github/workflows/run-daily-regression.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ jobs:
4141
with:
4242
name: regression-tests-results-${{ steps.date.outputs.date }}-${{ matrix.project }}-${{ github.run_id }}-${{ github.run_attempt }}
4343
path: playwright-report/
44-
retention-days: 30
44+
retention-days: 30

.github/workflows/run-p0-tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Run P0 tests
22

33
on:
4-
pull_request:
5-
branches: [ main ]
4+
pull_request:
5+
branches: [main]
66
workflow_dispatch:
77

88
jobs:
@@ -40,4 +40,4 @@ jobs:
4040
with:
4141
job_status: ${{ needs.run-p0-tests.result }}
4242
secrets:
43-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
43+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/run-smoke-tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Run smoke tests
22

33
on:
4-
pull_request:
5-
branches: [ main ]
4+
pull_request:
5+
branches: [main]
66
paths:
77
- 'playwright.config.ts'
88
- 'package.json'
@@ -38,4 +38,4 @@ jobs:
3838
with:
3939
name: smoke-tests-results-${{ matrix.project }}-${{ github.run_id }}
4040
path: playwright-report/
41-
retention-days: 7
41+
retention-days: 7

.github/workflows/slack-notification.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Post message to Slack
19-
env:
19+
env:
2020
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
2121
run: |
2222
PIPELINE_NAME="${{ github.workflow }}"
23-
23+
2424
case "${{ inputs.job_status }}" in
2525
"started") MESSAGE="🚀 $PIPELINE_NAME started" ;;
2626
"success") MESSAGE="✅ $PIPELINE_NAME succeeded" ;;
@@ -29,7 +29,7 @@ jobs:
2929
"skipped") MESSAGE="⏭️ $PIPELINE_NAME was skipped" ;;
3030
*) MESSAGE="⚠️ $PIPELINE_NAME - status: ${{ inputs.job_status }}" ;;
3131
esac
32-
32+
3333
curl -X POST -H 'Content-type: application/json' \
3434
--data "{\"text\":\"$MESSAGE\"}" \
3535
$SLACK_WEBHOOK_URL

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
test-results/
3+
playwright-report/
4+
yarn.lock
5+
package-lock.json
6+
*.log
7+

0 commit comments

Comments
 (0)