Skip to content

Commit

Permalink
feat: linters (#248)
Browse files Browse the repository at this point in the history
* feat: linters
  • Loading branch information
m30m authored Nov 20, 2024
1 parent a907ff7 commit 7ac2cf2
Show file tree
Hide file tree
Showing 15 changed files with 1,817 additions and 18 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
};
10 changes: 8 additions & 2 deletions .github/workflows/ci-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
with:
# Need to grab the history of the PR
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: "package.json"
registry-url: "https://registry.npmjs.org"
- uses: ./.github/actions/python-poetry
- uses: actions-rs/toolchain@v1
with:
Expand All @@ -28,9 +32,11 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1.1.1
with:
version: nightly
- name: Install npm dependencies
- name: Install evm contracts npm dependencies
working-directory: contracts/evm
run: npm install
run: npm ci
- name: Install npm dependencies
run: npm ci
- name: Install forge dependencies 1
working-directory: contracts/evm
run: forge install foundry-rs/forge-std@v1.8.0 --no-git --no-commit
Expand Down
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,31 @@ repos:
entry: cargo +stable clippy --manifest-path ./contracts/svm/Cargo.toml --tests -- -D warnings
pass_filenames: false
files: contracts/svm
# EsLint hooks
- id: eslint-limonade
name: eslint limonade
entry: npm run --prefix scripts/limonade lint
pass_filenames: false
language: system
files: scripts/limonade
- id: eslint-dex-router
name: eslint dex-router
entry: npm run --prefix scripts/dex-router lint
pass_filenames: false
language: system
files: scripts/dex-router
- id: eslint-opp-provider-limo
name: eslint opp-provider-limo
entry: npm run --prefix scripts/opportunity-provider-limo lint
pass_filenames: false
language: system
files: scripts/opportunity-provider-limo
- id: eslint-opp-provider
name: eslint opp-provider
entry: npm run --prefix scripts/opportunity-provider lint
pass_filenames: false
language: system
files: scripts/opportunity-provider
# For python files
- id: isort
name: isort
Expand Down
Loading

0 comments on commit 7ac2cf2

Please sign in to comment.