Skip to content

Commit

Permalink
Chore: React 18 (#1195)
Browse files Browse the repository at this point in the history
* chore: fix some lint

* chore: upgrade dependencies

* revert to react-script 4

* upgrade react-springs

* fix: line chart

* lint: add unused import and sort import rule

* lint: add husky and lint-staged

* better sort import

Signed-off-by: Nam Nguyen <nam.nguyen@kyber.network>

* run yarn lint --fix

Signed-off-by: Nam Nguyen <nam.nguyen@kyber.network>

* remove lint-staged and husky due to we already run lint on CI

* fix menulayout

* build: remove generate_source_map for save memory

* improve rule

Signed-off-by: Nam Nguyen <nam.nguyen@kyber.network>

Co-authored-by: Nam Nguyen <nam.nguyen@kyber.network>
Co-authored-by: Doan Sy Hung <hungdoansy@gmail.com>
  • Loading branch information
3 people authored Aug 5, 2022
1 parent f692805 commit 28c22ec
Show file tree
Hide file tree
Showing 564 changed files with 17,777 additions and 18,873 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ REACT_APP_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com
REACT_APP_KRYSTAL_API=https://api.krystal.app
REACT_APP_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4

GENERATE_SOURCEMAP=true
GENERATE_SOURCEMAP=false
REACT_APP_SERVICE_WORKER=false

REACT_APP_TRUESIGHT_API=https://truesight.kyberswap.com
Expand Down
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ REACT_APP_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com
REACT_APP_KRYSTAL_API=https://api.krystal.app
REACT_APP_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4

GENERATE_SOURCEMAP=true
GENERATE_SOURCEMAP=false
REACT_APP_SERVICE_WORKER=true

REACT_APP_TRUESIGHT_API=https://truesight.kyberswap.com
Expand Down
2 changes: 1 addition & 1 deletion .env.stg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ REACT_APP_AGGREGATOR_STATS_API=https://aggregator-stats.kyberswap.com
REACT_APP_KRYSTAL_API=https://api.krystal.app
REACT_APP_SENTRY_DNS=https://d94ee2d3c22043bdaec966758680b5a8@sentry.ops.kyberengineering.io/4

GENERATE_SOURCEMAP=true
GENERATE_SOURCEMAP=false
REACT_APP_SERVICE_WORKER=false

REACT_APP_TRUESIGHT_API=https://truesight.stg.kyberengineering.io
Expand Down
31 changes: 28 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,51 @@
"jsx": true
}
},
"ignorePatterns": ["node_modules/**/*"],
"ignorePatterns": [
"src/locales/**/*.js",
"src/locales/**/en-US.po",
"node_modules",
"src/**/charting_library.*",
"src/**/charting_library/**",
"build",
"dist",
".DS_Store",
".env.local",
".env.development.local",
".env.test.local",
".env.production.local",
".idea/",
".vscode/",
"public",
"package-lock.json",
"yarn.lock"
],
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"react-app",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"plugins": ["better-styled-components", "unused-imports"],
"rules": {
"unused-imports/no-unused-imports": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"prettier/prettier": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/camelcase": "off",
"react/prop-types": "off",
"@typescript-eslint/interface-name-prefix": "off",
"no-duplicate-imports": "error"
"no-duplicate-imports": "error",
"react/react-in-jsx-scope": "off",
"react/jsx-pascal-case": "off",
"@typescript-eslint/no-var-requires": "off"

}
}
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ jobs:
- name: Install dependences
uses: bahmutov/npm-install@HEAD

- name: Run Lint
run: yarn lint --quiet

- name: Yarn Build
env:
CI: false
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ jobs:
- name: Install dependences
uses: bahmutov/npm-install@HEAD

- name: Run Lint
run: yarn lint --quiet

- name: Yarn Build
env:
CI: false
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
- name: Install dependences
uses: bahmutov/npm-install@HEAD

- name: Run Lint
run: yarn lint --quiet

- name: Yarn Build
env:
CI: false
Expand Down
11 changes: 9 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,12 @@
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all",
"arrowParens": "avoid"
}
"arrowParens": "avoid",
"importOrder": [
"<THIRD_PARTY_MODULES>",
"^(apollo|assets|components|connectors|constants|data|hooks|locales|pages|state|theme|types|utils)(/.+)?$",
"^[./]"
],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
10 changes: 5 additions & 5 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ module.exports = function override(config, env) {
vendor: {
test: /[\\/]node_modules[\\/](ethers|@ethersproject)[\\/]/,
name: 'ethers',
chunks: 'all'
}
chunks: 'all',
},
// commons: {
// test: /[\\/]node_modules[\\/]/,
// // cacheGroupKey here is `commons` as the key of the cacheGroup
Expand All @@ -28,12 +28,12 @@ module.exports = function override(config, env) {
// },
// chunks: 'all'
// }
}
}
},
},
}

return {
...config,
plugins: [...config.plugins, new CompressionPlugin()]
plugins: [...config.plugins, new CompressionPlugin()],
}
}
50 changes: 0 additions & 50 deletions cypress/integration/add-liquidity.test.ts

This file was deleted.

22 changes: 0 additions & 22 deletions cypress/integration/landing.test.ts

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/integration/lists.test.ts

This file was deleted.

8 changes: 0 additions & 8 deletions cypress/integration/migrate-v1.test.ts

This file was deleted.

12 changes: 0 additions & 12 deletions cypress/integration/pool.test.ts

This file was deleted.

39 changes: 0 additions & 39 deletions cypress/integration/remove-liquidity.test.ts

This file was deleted.

11 changes: 0 additions & 11 deletions cypress/integration/send.test.ts

This file was deleted.

75 changes: 0 additions & 75 deletions cypress/integration/swap.test.ts

This file was deleted.

Loading

0 comments on commit 28c22ec

Please sign in to comment.