Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Prettier for test/cy code #1198

Merged
merged 9 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ jobs:
- run: just web install
- run: just web lint
- run: just web check-format

- run: just test/cy install
- run: just test/cy lint
- run: just test/cy check-format
5 changes: 4 additions & 1 deletion test/cy/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module.exports = {
extends: ['plugin:cypress/recommended'],
extends: [
'plugin:cypress/recommended',
'prettier'
],
plugins: ['cypress'],
env: {
'cypress/globals': true,
Expand Down
1 change: 1 addition & 0 deletions test/cy/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
14 changes: 14 additions & 0 deletions test/cy/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ lint:

npm run lint

format:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}

npm run format

check-format:
#!/usr/bin/env bash
set -eou pipefail
{{ _with_debug }}

npm run check-format

# Install dependencies
install:
#!/usr/bin/env bash
Expand Down
29 changes: 29 additions & 0 deletions test/cy/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions test/cy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"scripts": {
"lint": "eslint --ext .js,.ts,.cjs .",
"fix": "eslint --ext .js,.ts,.cjs . --fix",
"format": "prettier . --write",
"check-format": "prettier . --check",
"init": "just ../../run init ./test/sample-content/fastapi-simple",
"start": "just ../../run ui --listen 127.0.0.1:9000 ./test/sample-content/fastapi-simple",
"test": "start-server-and-test --expect 200 start http-get://127.0.0.1:9000 run",
Expand All @@ -18,7 +20,9 @@
"devDependencies": {
"cypress": "^13.3.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-cypress": "^2.15.1",
"prettier": "3.2.5",
"start-server-and-test": "^2.0.3"
}
}
Loading