Skip to content

Commit

Permalink
[ECO-2244] Add js/ts linting to pre-commit (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
CRBl69 authored Oct 16, 2024
1 parent 9518001 commit f1a02ef
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
env:
POETRY_VERSION: '1.8.2'
PYTHON_VERSION: '3.10'
TS_DIR: 'src/typescript'
jobs:
pre-commit:
runs-on: 'ubuntu-latest'
Expand All @@ -20,6 +21,14 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libdw-dev
- uses: 'actions/setup-node@v4'
with:
node-version-file: '${{ env.TS_DIR }}/.node-version'
registry-url: 'https://registry.npmjs.org'
- uses: 'pnpm/action-setup@v4'
with:
package_json_file: '${{ env.TS_DIR }}/package.json'
- run: 'cd ${{ env.TS_DIR }} && pnpm i'
- name: 'Cache Poetry Install'
uses: 'actions/cache@v3'
with:
Expand Down
10 changes: 10 additions & 0 deletions cfg/pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ repos:
name: 'mypy'
types:
- 'python'
-
entry: |
pnpm run lint
files: 'src/typescript'
id: 'pnpm'
language: 'node'
name: 'lint typescript'
pass_filenames: false
types:
- 'directory'
repo: 'local'
-
hooks:
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"e2e:frontend": "playwright test --project=firefox",
"format": "pnpm _format --write",
"format:check": "pnpm _format --check",
"lint": "eslint -c .eslintrc.js --ext .js,.jsx,.ts,.tsx .",
"lint": "eslint --max-warnings=0 -c .eslintrc.js --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "pnpm run lint --fix",
"playwright:install": "playwright install --with-deps",
"pre-commit": "pnpm run pre-commit:install && pnpm run pre-commit:run",
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"e2e:testnet": "pnpm load-test-env -v NO_TEST_SETUP=true -- pnpm jest tests/e2e/queries/testnet",
"format": "pnpm _format --write",
"format:check": "pnpm _format --check",
"lint": "eslint 'src/**/*.ts' 'tests/**/*.ts' -c .eslintrc.js",
"lint": "eslint --max-warnings=0 'src/**/*.ts' 'tests/**/*.ts' -c .eslintrc.js",
"lint:fix": "pnpm lint --fix",
"pre-commit": "pnpm run pre-commit:install && pnpm run pre-commit:run",
"pre-commit:install": "pre-commit install -c ../../../cfg/pre-commit-config.yaml",
Expand Down

0 comments on commit f1a02ef

Please sign in to comment.