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

chore: Add eslint config #1980

Merged
merged 40 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a89ab1d
chore: Install @dcl/eslint-config package
cyaiox Aug 17, 2023
60514bd
chore: Add eslint and prettier configs
cyaiox Aug 17, 2023
c482c7f
chore: Install husky package
cyaiox Aug 17, 2023
1963b7c
fix: Move @dcl/eslint-config to devDependencies
cyaiox Aug 17, 2023
81847fd
chore: Remove tslint
cyaiox Aug 17, 2023
c10bdec
fix: Prettier config
cyaiox Aug 17, 2023
58fe004
fix: Husky install
cyaiox Aug 17, 2023
71c9c1b
fix: Update eslint plugins packages
cyaiox Aug 17, 2023
f0001d1
fix: packages
cyaiox Aug 17, 2023
49c036a
chore: override prettier rules to match marketplace prettier
cyaiox Aug 17, 2023
16b30f4
chore: Add eslint config file to tsconfig
cyaiox Aug 17, 2023
546015b
Merge branch 'master' of github.com:decentraland/marketplace into cho…
LautaroPetaccio Mar 7, 2024
faec850
fix: Update package
LautaroPetaccio Mar 7, 2024
e32283c
fix: Remove prettier config
LautaroPetaccio Mar 7, 2024
a12943d
fix: Prettierrc
LautaroPetaccio Mar 7, 2024
ed5a48c
fix: Update files
LautaroPetaccio Mar 8, 2024
ab6ae1b
fix: Basic linting proccesses
LautaroPetaccio Mar 8, 2024
d687187
fix: More fixes to files
LautaroPetaccio Mar 8, 2024
f0f3fdf
fix: Husky prepare
LautaroPetaccio Mar 8, 2024
e3c7ba6
fix: Auto-fixes
LautaroPetaccio Mar 8, 2024
e5f1e62
Merge branch 'master' of github.com:decentraland/marketplace into cho…
LautaroPetaccio Mar 8, 2024
29c54d2
fix: Auto-fixes
LautaroPetaccio Mar 8, 2024
ade19be
fix: Fixes
LautaroPetaccio Mar 8, 2024
c9f01d9
fix: Move .husky to correct directory
LautaroPetaccio Mar 8, 2024
75117e6
fix: Things
LautaroPetaccio Mar 8, 2024
d7347bc
Merge branch 'master' of github.com:decentraland/marketplace into cho…
LautaroPetaccio Mar 11, 2024
a466c77
Merge branch 'master' of github.com:decentraland/marketplace into cho…
LautaroPetaccio Mar 11, 2024
861f8b9
fix: Merge
LautaroPetaccio Mar 11, 2024
9c596bb
fix: Reselect
LautaroPetaccio Mar 11, 2024
f741e6c
chore: Upgrade package-lock.json
cyaiox Mar 11, 2024
f1ae910
fix: package-lock file
cyaiox Mar 11, 2024
daf4051
fix: Dependencies
LautaroPetaccio Mar 11, 2024
9a5c2de
fix: React-redux
LautaroPetaccio Mar 11, 2024
d188ea4
Revert "fix: React-redux"
LautaroPetaccio Mar 11, 2024
9f4a685
fix: Redux-logger version
LautaroPetaccio Mar 11, 2024
8facb02
fix: Redux-logger types
LautaroPetaccio Mar 11, 2024
22d8e37
fix: package-lock.json
cyaiox Mar 11, 2024
9e49665
chore: Upgrade audit workflow
cyaiox Mar 11, 2024
3344564
fix: Removed unecessary override
LautaroPetaccio Mar 11, 2024
e7bff2d
fix: Job name
LautaroPetaccio Mar 11, 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
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
node-version: 18.x
cache: "npm"
cache-dependency-path: webapp/package-lock.json
- name: Upgrade npm
run: npm i -g npm
- name: Install
run: npm i --legacy-peer-deps
- name: Audit signatures
Expand Down
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:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./webapp
steps:
- uses: actions/checkout@master
- name: Use Node.js 18.x
uses: actions/[email protected]
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

63 changes: 63 additions & 0 deletions webapp/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* eslint-env node */
module.exports = {
extends: ['@dcl/eslint-config/dapps'],
parserOptions: {
project: ['tsconfig.json'],
tsconfigRootDir: __dirname
},
plugins: ['react-hooks'],
overrides: [
{
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
Loading