Skip to content

Commit

Permalink
Merge 22d8e37 into 0f60e26
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Mar 11, 2024
2 parents 0f60e26 + 22d8e37 commit cd3f943
Show file tree
Hide file tree
Showing 730 changed files with 18,494 additions and 33,669 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Lint

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./webapp
steps:
- uses: actions/checkout@master
- name: Use Node.js 18.x
uses: actions/setup-node@v4.0.1
with:
node-version: 18.x
cache: "npm"
cache-dependency-path: webapp/package-lock.json
- name: Install
run: npm install --legacy-peer-deps
- name: Lint
run: npm run lint
1 change: 1 addition & 0 deletions indexer/.subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,4 @@ templates:
handler: handleTransfer
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer

79 changes: 79 additions & 0 deletions webapp/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* eslint-env node */
module.exports = {
extends: ['@dcl/eslint-config/dapps'],
parserOptions: {
project: ['tsconfig.json'],
tsconfigRootDir: __dirname
},
plugins: ['react-hooks'],
overrides: [
{
files: ['*.js', '*.ts', '*.tsx'],
rules: {
['prettier/prettier']: [
'error',
{
semi: false,
singleQuote: true,
printWidth: 140,
tabWidth: 2,
trailingComma: 'none',
arrowParens: 'avoid'
}
]
}
},
{
files: ['*.ts', '*.tsx', '*.cjs'],
extends: ['plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', 'prettier'],
rules: {
'@typescript-eslint/no-unsafe-declaration-merging': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-declaration-merging
'@typescript-eslint/no-redundant-type-constituents': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-redundant-type-constituents
'@typescript-eslint/require-await': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/require-await
'@typescript-eslint/no-floating-promises': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-floating-promises
'@typescript-eslint/no-unsafe-return': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-return
'@typescript-eslint/naming-convention': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/naming-convention/
'@typescript-eslint/no-unused-vars': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unused-vars
'@typescript-eslint/no-unnecessary-type-assertion': 'error', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unnecessary-type-assertion
'@typescript-eslint/explicit-module-boundary-types': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/explicit-module-boundary-types
'@typescript-eslint/restrict-template-expressions': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/restrict-template-expressions
'@typescript-eslint/no-base-to-string': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-base-to-string
'@typescript-eslint/ban-types': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/ban-types
'@typescript-eslint/unbound-method': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/unbound-method
'@typescript-eslint/ban-ts-comment': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/ban-ts-comment
'no-prototype-builtins': 'off', // TODO: migrate code progressively to remove this line. https://eslint.org/docs/rules/no-prototype-builtins
'no-case-declarations': 'off', // TODO: migrate code progressively to remove this line. https://eslint.org/docs/rules/no-case-declarations
'@typescript-eslint/no-unsafe-assignment': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-assignment/
'@typescript-eslint/no-unsafe-call': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-call/
'@typescript-eslint/no-unsafe-member-access': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-member-access/
'@typescript-eslint/no-unsafe-argument': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-argument/
'@typescript-eslint/no-explicit-any': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-explicit-any
'@typescript-eslint/no-non-null-assertion': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-non-null-assertion
'no-async-promise-executor': 'off', // TODO: migrate code progressively to remove this line. https://eslint.org/docs/rules/no-async-promise-executor
'@typescript-eslint/await-thenable': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/await-thenable
'@typescript-eslint/no-unnecessary-type-constraint': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unnecessary-type-constraint
'@typescript-eslint/no-misused-promises': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-misused-promises
'require-yield': 'off', // TODO: migrate code progressively to remove this line. https://eslint.org/docs/rules/require-yield
'import/order': 'off', // TODO: migrate code progressively to remove this line.
'no-empty': 'off', // TODO: migrate code progressively to remove this line. https://eslint.org/docs/rules/no-empty
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain
'@typescript-eslint/no-unsafe-enum-comparison': 'off'
},
parserOptions: {
project: ['./tsconfig.json']
}
},
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/unbound-method': 'off'
}
},
{
files: ['*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off'
}
}
]
}
16 changes: 16 additions & 0 deletions webapp/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
cd ./webapp

FILES=$(git diff --cached --name-only --relative=webapp --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx|json|yml|md|html|css)$' || true; })

if [ -z "$FILES" ]; then
exit 0
fi

TS_FILES=$(git diff --cached --name-only --relative=webapp --diff-filter=ACMR | sed 's| |\\ |g' | { grep -E '(js|ts|tsx)$' || true; })

if [[ ! -z "$TS_FILES" ]];then
echo "Running lints"
npm run pre-commit:fix:code -- $TS_FILES
fi
8 changes: 8 additions & 0 deletions webapp/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 140,
"tabWidth": 2,
"trailingComma": "none",
"arrowParens": "avoid"
}
Loading

0 comments on commit cd3f943

Please sign in to comment.