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

Feature/eslint config package #545

Merged
merged 132 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
b18f7b5
hop-node: update linter
shanefontaine Dec 22, 2023
80b2805
hop-node: handle all inline rules
shanefontaine Dec 22, 2023
ab548d1
hop-node: additional inline lint rule handling
shanefontaine Dec 22, 2023
cd37ceb
hop-node: linting updates
shanefontaine Dec 22, 2023
a75eb82
hop-node: lint
shanefontaine Dec 22, 2023
c008458
hop-node: udpate typescript and lint
shanefontaine Dec 23, 2023
073242a
Merge branch 'develop' into feat/lint-updates
shanefontaine Dec 23, 2023
c046989
hop-node: update tsconfig
shanefontaine Dec 28, 2023
c183ac5
hop-node: udpate eslint
shanefontaine Dec 28, 2023
a979eb4
hop-node: add noImplicitOverride
shanefontaine Dec 28, 2023
448e65e
hop-node: lint
shanefontaine Dec 28, 2023
b6fba24
hop-node: use node built-in fetch
shanefontaine Dec 28, 2023
f448393
hop-node: clean up package.json
shanefontaine Dec 28, 2023
f8d6e57
hop-node: lint
shanefontaine Dec 28, 2023
5786806
hop-node: pin deps and rm docker cache
shanefontaine Dec 28, 2023
3aabd42
hop-node: lint
shanefontaine Dec 28, 2023
6fecd34
Set up eslint-config-hop-protocol package
miguelmota Jan 8, 2024
36a0f9b
frontend/sdk: use hop lint config package
miguelmota Jan 8, 2024
7e8358d
core/api: use hop lint config package
miguelmota Jan 9, 2024
05a7ef4
Remove ipfs-worker package since it's not used
miguelmota Jan 9, 2024
19c0a4e
Remove sdk-api-demo package in favor of api package that's similar
miguelmota Jan 9, 2024
a2d236d
stats-worker: use hop lint config package
miguelmota Jan 9, 2024
7e193f9
eslint: add readme
miguelmota Jan 9, 2024
75dc29d
hop-node: use hop lint config package
miguelmota Jan 9, 2024
111d640
Update package sync version dep
miguelmota Jan 10, 2024
8a04af7
Update typescript/eslint version
miguelmota Jan 10, 2024
3ab57b7
eslint-config: Update rules
miguelmota Jan 10, 2024
e821fb0
sdk: Lint
miguelmota Jan 10, 2024
2a6d149
hop-node: Lint
miguelmota Jan 10, 2024
43f4bf0
stats-worker: Lint
miguelmota Jan 10, 2024
a9a8cd8
frontend: Lint
miguelmota Jan 10, 2024
7d2eefb
Merge
miguelmota Jan 10, 2024
5a02501
core: Lint
miguelmota Jan 10, 2024
dd1f5ce
gh-actions: add eslint config npm package publish workflow
miguelmota Jan 10, 2024
0d8a65a
frontend: eslint fixes
miguelmota Jan 10, 2024
4fa1cb2
eslint-config: Update config
miguelmota Jan 10, 2024
69a9fef
core: type fix
miguelmota Jan 10, 2024
9dcc651
Merge
miguelmota Jan 11, 2024
19bf14c
eslint-config: update config, lint
miguelmota Jan 11, 2024
9d8590d
hop-node: re-add type checked eslint extends
miguelmota Jan 11, 2024
7312c1e
Remove artifact
miguelmota Jan 12, 2024
19782a3
Hoist eslint config to root, lint fixes
miguelmota Jan 12, 2024
6faaaa6
eslint: Set node env true in sub packages
miguelmota Jan 12, 2024
ff7d9e3
Add root level tsconfig, build fixes
miguelmota Jan 12, 2024
6780209
Update tsconfig for subpackages
miguelmota Jan 12, 2024
e09af26
Clean up
miguelmota Jan 12, 2024
1dc99b0
hop-node: Update Dockerfile to use npm workspaces
miguelmota Jan 13, 2024
e32560f
hop-node: Update Dockerfile install
miguelmota Jan 13, 2024
d66ca89
Add github actions hop node build workflow
miguelmota Jan 14, 2024
166538f
github-action: hop node build and push
miguelmota Jan 15, 2024
a3e8f9d
frontend: Update dev deps, gh-actions: Add hop api yml
miguelmota Jan 15, 2024
057d8c1
eslint: update dep version
miguelmota Jan 15, 2024
7bdbae5
gh-actions: Update debug frontend build docker
miguelmota Jan 15, 2024
8c3b3e2
gh-actions: Update debug frontend build docker
miguelmota Jan 15, 2024
0a746f8
all: various lint updates
shanefontaine Jan 15, 2024
cba066c
Merge remote-tracking branch 'origin/feature/eslint-config-package' i…
shanefontaine Jan 15, 2024
0c2b305
all: various lint updates
shanefontaine Jan 16, 2024
e4c0ef2
gh-actions: hop api workflow updates
miguelmota Jan 16, 2024
0753325
gh-actions: stats worker build workflow
miguelmota Jan 16, 2024
70b46ca
gh-actions: Add status notification webhook workflow
miguelmota Jan 16, 2024
26d870a
Delete circleci config
miguelmota Jan 16, 2024
6ff00d9
gh-actions: Update npm publish workflow
miguelmota Jan 16, 2024
997f5ab
gh-actions: optimize hop api docker image
miguelmota Jan 17, 2024
2dad3b6
gh-actions: clean up hop api build action file
miguelmota Jan 17, 2024
71c3ec8
gh-actions: optimize stats worker action
miguelmota Jan 17, 2024
4ca34d5
gh-actions: status webhook
miguelmota Jan 17, 2024
c329c7a
gh-actions: clean up core/sdk publish action
miguelmota Jan 17, 2024
8109e8f
gh-actions: optimize hop node build action
miguelmota Jan 17, 2024
8d3d078
fe: lint
shanefontaine Jan 17, 2024
49a8b75
all: lint
shanefontaine Jan 17, 2024
8d26650
gh-actions: update notification webhooks
miguelmota Jan 18, 2024
b4c65c7
hop-api: use typescript, dockerfile updates
miguelmota Jan 18, 2024
b311afb
stats-worker: dockerfile fixes
miguelmota Jan 18, 2024
e1a781f
hop-api: type fixes
miguelmota Jan 18, 2024
ca104cb
hop-node: dockerfile fixes
miguelmota Jan 18, 2024
f932b4b
all: simplify packages, configs, and eslints and rm unused logic
shanefontaine Jan 18, 2024
beeae17
Merge branch 'feature/eslint-config-package' of github.com:hop-protoc…
shanefontaine Jan 18, 2024
14a610e
all: update config
shanefontaine Jan 18, 2024
684a57f
root: update package comments
shanefontaine Jan 18, 2024
c640a30
root: clearer comments
shanefontaine Jan 18, 2024
aefd2e1
Merge pull request #546 from hop-protocol/feat/temp-lint
shanefontaine Jan 18, 2024
beb4323
Merge
miguelmota Jan 18, 2024
02f14fa
Merge
miguelmota Jan 19, 2024
0bbbe21
frontend: remove walletconnect temp fix
miguelmota Jan 19, 2024
359bdb3
Merge
miguelmota Jan 19, 2024
fe95686
sdk: build: Remove ls log artifact
miguelmota Jan 19, 2024
d88ae22
Merge
miguelmota Jan 19, 2024
e91d0f1
frontend: Lint
miguelmota Jan 19, 2024
a52b681
sdk: fix merge
shanefontaine Jan 19, 2024
a848166
all: fix dependabot
shanefontaine Jan 19, 2024
6e1b38e
fe: update package and rm temp fix
shanefontaine Jan 19, 2024
c871582
fe: rm unused resolution
shanefontaine Jan 19, 2024
67859cc
Merge branch 'feature/eslint-config-package' of github.com:hop-protoc…
shanefontaine Jan 19, 2024
dc254cf
all: reintroduce npx
shanefontaine Jan 19, 2024
ab59892
all: reintro -p to npx
shanefontaine Jan 19, 2024
1b9262b
fe: fix merge and versions
shanefontaine Jan 19, 2024
8ae4853
all: various updates
shanefontaine Jan 19, 2024
56fa157
all: various config updates
shanefontaine Jan 19, 2024
28d7160
all: resolve cache issues with tsbuildinfo
shanefontaine Jan 19, 2024
1ebe408
all: use rm -rf instead of rimraf
shanefontaine Jan 20, 2024
b4fc158
all: us rm rf
shanefontaine Jan 20, 2024
81eb227
All: config updates
shanefontaine Jan 23, 2024
17e1088
all: update package.json configs
shanefontaine Jan 23, 2024
711f2a9
hop-node: rm unused
shanefontaine Jan 23, 2024
3643d81
all: rm unused makes
shanefontaine Jan 24, 2024
ebe1b21
hop-node: update db path to match new dist
shanefontaine Jan 24, 2024
0a3314f
all: modernize package.json files
shanefontaine Jan 24, 2024
76cc491
all: normalize eslintrc
shanefontaine Jan 24, 2024
a75e350
all: standardize eslint
shanefontaine Jan 24, 2024
f50feab
hop-node: lint
shanefontaine Jan 24, 2024
29550b5
core: Copy dist to top level
miguelmota Jan 24, 2024
1193580
frontend: Lint
miguelmota Jan 24, 2024
7d4d2c0
all: standardize config
shanefontaine Jan 24, 2024
224f28a
Merge branch 'feature/eslint-config-package' of github.com:hop-protoc…
shanefontaine Jan 24, 2024
436cfd5
all: simplify config
shanefontaine Jan 25, 2024
5a7c4a9
all: update node version
shanefontaine Jan 25, 2024
f3506ca
all: update packages
shanefontaine Jan 25, 2024
b3ba40c
all: update fe packages
shanefontaine Jan 26, 2024
2836fe9
all: various updates
shanefontaine Jan 27, 2024
dccd23f
all: readme updates
shanefontaine Jan 27, 2024
67b57fe
all: simpliifcation and optimization
shanefontaine Jan 28, 2024
3a2b360
hop-node: various optimizations
shanefontaine Jan 28, 2024
8428fc8
hop-node: updated lockfile
shanefontaine Jan 28, 2024
8999bf2
all: final lint
shanefontaine Jan 28, 2024
8d4025e
all: updated lockfile
shanefontaine Jan 28, 2024
0b04251
all: update package versions
shanefontaine Jan 28, 2024
1285353
sdk: rm optimism package to remove SDK size by 68.8%
shanefontaine Jan 28, 2024
2ac8579
all: PR review cleanup
shanefontaine Jan 29, 2024
9768d45
hop-node: update dockerfile
shanefontaine Jan 29, 2024
10e7055
all: updated lockfile
shanefontaine Jan 29, 2024
508957a
core: deprecate core/build/addresses
shanefontaine Jan 29, 2024
8c5242b
hop-node: rm swc
shanefontaine Jan 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
197 changes: 0 additions & 197 deletions .circleci/config.yml

This file was deleted.

90 changes: 90 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
module.exports = {
root: true,
env: {
node: true,
es2021: true,
jest: true,
browser: true
},
plugins: [
'n',
'@typescript-eslint',
'unused-imports',
'sort-imports-es6-autofix'
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
project: [
'./tsconfig.json',
'./packages/*/tsconfig.json'
],
tsconfigRootDir: __dirname
},
rules: {
// Explicit offs
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'avoidEscape': 'off',
'camelcase': 'off',
'no-async-promise-executor': 'off',
'no-unreachable-loop': 'off',
'no-unused-vars': 'off',
'no-constant-condition': 'off',

// Explicit warns
'unused-imports/no-unused-imports': 'warn',
'sort-imports-es6-autofix/sort-imports-es6': [1, {
ignoreCase: false,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'single', 'multiple', 'all']
}],

// Explicit errors
'array-callback-return': 'error',
'block-scoped-var': 'error',
'dot-notation': 'error',
'new-cap': [2, { 'properties': false }], // Used by ethers event filters
'no-empty': [2, { 'allowEmptyCatch': true }],
'no-new': 'error',
'prefer-const': [2, { 'destructuring': 'all' }],
'n/no-new-require': 'error',
'n/no-path-concat': 'error',
// Note: for @typescript-eslint/return-await', you must disable the base rule as it can report incorrect errors
'no-return-await': 'off',
'@typescript-eslint/return-await': 'error',

// Custom - These allow `any`. Remove over time as codebase is cleaned up
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'off',

// Custom - Set to 1 or 2 over time as codebase is cleaned up. Possibly add options
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'no-else-return': 'off', // Could be a 1 but --fix does not correctly indent
// https://github.com/eslint/eslint/issues/3400
'no-lonely-if': 'off', // Could be a 1 but erroneously fixes nested items. Nesting is user error but still not worth the hassle
'@typescript-eslint/no-unnecessary-condition': 0 // Nice to have but need to clean up first
},
ignorePatterns: [
'node_modules',
'build',
'dist'
]
}
13 changes: 8 additions & 5 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy
name: Simple Github Action for Debugging Builds
on:
push:
branches:
Expand All @@ -11,24 +11,27 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/frontend
working-directory: .
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up node
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org

- name: Install node dependencies
run: npm install --legacy-peer-deps
run: |
npm install -g pnpm@latest # required to build @eth-optimism packages
npm install -g only-allow@latest # required to build @eth-optimism packages
npm install

- name: Build the frontend app
env:
PUBLIC_URL: .
REACT_APP_NETWORK: goerli
REACT_APP_IPFS_BUILD: true
run: npm run build
run: NODE_OPTIONS=--openssl-legacy-provider npm run build --workspace=@hop-protocol/frontend

19 changes: 11 additions & 8 deletions .github/workflows/deploy.yml → .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy
name: Build and Deploy Hop Frontend UI
on:
push:
branches:
Expand Down Expand Up @@ -37,15 +37,16 @@ jobs:
echo "dnslink_subdomain=_dnslink.${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
fi

call-workflow1:
call-core-publish-workflow:
name: Publish NPM Core Package If Necessary
uses: ./.github/workflows/npm_publish_core.yml
with:
environment: production
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
call-workflow2:
needs: call-workflow1

call-sdk-publish-workflow:
needs: call-core-publish-workflow
name: Publish NPM SDK Package If Necessary
uses: ./.github/workflows/npm_publish_sdk.yml
with:
Expand Down Expand Up @@ -76,7 +77,7 @@ jobs:
if: contains(github.ref, 'production') || contains(github.ref, 'preprod') || contains(github.ref, 'mainnet')
name: Build and Deploy
runs-on: ubuntu-latest
needs: [set_environment, call-workflow2]
needs: [set_environment, call-sdk-publish-workflow]
outputs:
hash: ${{ steps.upload.outputs.hash }}
environment:
Expand All @@ -87,7 +88,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
defaults:
run:
working-directory: ./packages/frontend
working-directory: .
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -104,7 +105,9 @@ jobs:
registry-url: https://registry.npmjs.org

- name: Install node dependencies
run: npm install --legacy-peer-deps
run: |
npm install -g only-allow@latest pnpm@latest # required to build @eth-optimism packages
npm install

- name: Build the frontend app
env:
Expand All @@ -122,7 +125,7 @@ jobs:
REACT_APP_DISABLED_ROUTES_NO_LIQUIDITY_WARNING_MESSAGE: ${{ secrets.REACT_APP_DISABLED_ROUTES_NO_LIQUIDITY_WARNING_MESSAGE }}
REACT_APP_SHOW_BANNER_MESSAGE: ${{ secrets.REACT_APP_SHOW_BANNER_MESSAGE }}
REACT_APP_BLOCKLIST_ENABLED: ${{ secrets.REACT_APP_BLOCKLIST_ENABLED }}
run: npm run build
run: NODE_OPTIONS=--openssl-legacy-provider npm run build --workspace=@hop-protocol/frontend

- name: Write commit file
uses: "DamianReeves/write-file-action@a432935930b2e351ec2d2792fc220717b656ec1c"
Expand Down
Loading