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

Quick lint #1238

Merged
merged 12 commits into from
May 22, 2024
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**/*bundle*.js

Check warning on line 1 in .eslintignore

View workflow job for this annotation

GitHub Actions / check

File ignored by default.
**/ProcaptchaWidget-*.js
**/index-*.js
**/typechain/*
Expand Down Expand Up @@ -42,3 +42,8 @@
.env.*
**/assets/*.js
*.min.js
**/Readme.md
**/README.md
code-of-conduct.md
diagram.svg
**/.eslintignore
16 changes: 14 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ jobs:

- run: npm ci

- run: npm run build -w @prosopo/scripts
- run: npm run -w @prosopo/scripts build

- run: npm run lint
- name: license
run: npm run -w @prosopo/scripts license

- name: lint
run: |
# get the files which have changed in the PR
files=$(curl -L -s -H "Authorization: Bearer ${{ github.token }}" -H "Accept: application/vnd.github.v3+json" "${{ github.event.pull_request.url }}/files" | jq -r '.[] | .filename')

echo "files: $files"

# feed those files into eslint + prettier, as we only need to lint the files that have changed
npx eslint --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files
npx prettier --check --ignore-path .eslintignore --no-error-on-unmatched-pattern -- $files
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"test": "npm run --workspaces test",
"test:all": "npm run --workspaces --if-present test",
"eslint": "npm --workspaces run eslint && npm run eslint:workspace",
"eslint:workspace": "npx eslint '.*.*' '*.*' .vscode .github --ignore-pattern README.md --ignore-pattern code-of-conduct.md --ignore-pattern diagram.svg --ignore-path .eslintignore --quiet",
"eslint:workspace": "npx eslint '.*.*' '*.*' .vscode .github --ignore-path .eslintignore --quiet",
"eslint:contracts": "npm -w @prosopo/captcha-contract -w @prosopo/common-contract -w @prosopo/proxy-contract run eslint",
"eslint:fix": "npm --workspaces run eslint:fix && npm run eslint:fix:workspace",
"eslint:fix:workspace": "npm run eslint:workspace -- --fix",
Expand Down
Loading