-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Linting, TS Config + CI (#48)
* Add trade page w/ new layout * Add recent swaps to explorer page * Add swaps component * Add PairSelector component * Setup eslint, prettier + tsconfig * Cleanup backup files * Add ci workflow * Add pnpm version * Remove unknown option for ci.yml * Fix linting issues * Add disable rules for older files * Cleanup files * Fix lint warnings for now * Fix strict lints --------- Co-authored-by: Lucas Meier <lucas@cronokirby.com>
- Loading branch information
1 parent
11df3ae
commit 7393891
Showing
69 changed files
with
1,854 additions
and
679 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: CI | ||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: buildjet-8vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: lint | ||
uses: buildjet/cache@v4 | ||
with: | ||
path: .next | ||
key: $${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-lint | ||
restore-keys: $${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled | ||
- uses: pnpm/action-setup@v4 | ||
- uses: buildjet/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
cache: "pnpm" | ||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm lint:strict | ||
|
||
build: | ||
name: Build | ||
runs-on: buildjet-8vcpu-ubuntu-2204 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: build | ||
uses: buildjet/cache@v4 | ||
with: | ||
path: .next | ||
key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-built | ||
restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled | ||
- uses: pnpm/action-setup@v4 | ||
- uses: buildjet/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
cache: "pnpm" | ||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm build | ||
|
||
# test: | ||
# name: test | ||
# runs-on: buildjet-4vcpu-ubuntu-2204 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - id: tested | ||
# uses: buildjet/cache@v4 | ||
# with: | ||
# path: .next | ||
# key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-test | ||
# restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled | ||
# - uses: pnpm/action-setup@v4 | ||
# - uses: buildjet/setup-node@v4 | ||
# with: | ||
# node-version: "22" | ||
# cache: "pnpm" | ||
# - run: pnpm install --frozen-lockfile | ||
# - run: pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import eslintConfig from 'configs/eslint'; | ||
import { FlatCompat } from '@eslint/eslintrc'; | ||
import { fileURLToPath } from 'url'; | ||
import path from 'path'; | ||
|
||
// mimic CommonJS variables -- not needed if using CommonJS | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
}); | ||
|
||
const excludePlugins = eslintConfig.flatMap(config => Object.keys(config.plugins || {})); | ||
|
||
export default [ | ||
...compat | ||
.extends('next/core-web-vitals') | ||
.filter(config => | ||
Object.keys(config.plugins || {}).every(plugin => !excludePlugins.includes(plugin)), | ||
), | ||
|
||
...eslintConfig.filter(config => config.name !== 'custom:turbo-config'), | ||
|
||
{ | ||
name: 'ignore-old-ts-files', | ||
rules: { | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
}, | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.