From 38d6f426fce7e76d0b92801eec9c34946d652b57 Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Mon, 3 Jul 2023 14:14:15 +0800 Subject: [PATCH 1/3] Ako / FEQ 400/ Fix ci failings (#9190) * build: update max_worker for circleci runner * build: add accounts build before all the rest * ci: disable proptypes for ts and tsx on husky * build: fix typo on the script --- .eslintrc.js | 6 ++++++ .lintstagedrc.json | 2 +- package.json | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d2232cb9e4f0..7e92e4c7d145 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -138,6 +138,12 @@ module.exports = { }, }, overrides: [ + { + files: ['*.ts', '*.tsx'], + rules: { + 'react/prop-types': 'off', + }, + }, { files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], extends: ['plugin:testing-library/react'], diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 04bd9b118600..22127938375e 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,5 +1,5 @@ { "*.{js,jsx,ts,tsx,md,html,css,scss}": "prettier --write", - "*.{js,jsx,ts,tsx}": "npx eslint --fix", + "*.{js,jsx,ts,tsx}": "eslint --fix --config .eslintrc.js", "*.{css,scss}": "npx stylelint --fix" } diff --git a/package.json b/package.json index 57eaf99bbe17..d040452fab60 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "ts-jest": "^26.4.2" }, "scripts": { - "build:all": "nx build @deriv/components --skip-nx-cache && nx run-many --target=build", + "build:all": "nx build @deriv/components --skip-nx-cache && nx build @deriv/account --skip-nx-cache && nx run-many --target=build", "build:one": "f () { nx build @deriv/$1 $2 ;}; f", "build:since": "nx affected --target=build", "test:eslint-all": "nx run-many --target=test:eslint", @@ -91,7 +91,7 @@ "publish_package": "f () { lerna exec --scope=@deriv/${1:-'*'} -- npm run publish_package $2 ;}; f", "serve": "f () { lerna exec --scope=@deriv/${1:-'*'} -- npm run serve $npm_config_open;}; f", "start": "f () { lerna exec --scope=@deriv/${1:-'*'} -- npm run start ;}; f", - "test": "f () { bash ./scripts/circleci-config.test.sh && npm run test:stylelint && npm run test:eslint-all && npm run test:jest ;}; f", + "test": "f () { bash ./scripts/circleci-config.test.sh && npm run test:stylelint && npm run test:eslint-all && JEST_MAX_WORKERS=6 npm run test:jest ;}; f", "test:stylelint": "stylelint \"./packages/*/src/**/*.s(a|c)ss\"", "test:jest": "jest --all --maxWorkers=${JEST_MAX_WORKERS:-'45%'}", "test:e2e": "cd end-to-end-test && npx playwright test", From d112c0d48e00477b30f17fe41283234a3a64e382 Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Mon, 3 Jul 2023 14:49:43 +0800 Subject: [PATCH 2/3] Ako/ add overrides attr to eslintrc to fix husky pre commit issue (#9199) * ci: add overrides attr to eslintrc * build: add ts to eslint script * ci: remove override attr --- packages/components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/components/package.json b/packages/components/package.json index a86634a87a29..a305e9ad9577 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -15,7 +15,7 @@ "build:icons-manifest": "node -e 'require(\"./utils/build-icons-manifest\").buildIconsManifest()'", "build:travis": "rimraf lib && webpack --mode=production", "test": "node \"./src/components/icon/__tests__/icons.js\"", - "test:eslint": "eslint \"./src/**/*.?(js|jsx)\"", + "test:eslint": "eslint \"./src/**/*.?(js|jsx|ts|tsx)\"", "deploy": "echo \"No deploy specified\"", "deploy:clean": "echo \"No deploy:clean specified\"", "deploy:folder": "echo \"No deploy:folder specified\"", From 5dff230618932204b25dfe240a04a5404f21cba7 Mon Sep 17 00:00:00 2001 From: "Ali(Ako) Hosseini" Date: Mon, 3 Jul 2023 15:07:21 +0800 Subject: [PATCH 3/3] Fix husky issue (#9201) * ci: add overrides attr to eslintrc * build: add ts to eslint script * ci: remove override attr * ci: add overrides to eslint config * build: remove ts from eslint script --- packages/components/.eslintrc.js | 8 ++++++++ packages/components/package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/components/.eslintrc.js b/packages/components/.eslintrc.js index 998e0b71b6f0..8c11f1834b9d 100644 --- a/packages/components/.eslintrc.js +++ b/packages/components/.eslintrc.js @@ -2,6 +2,14 @@ const webpackConfig = require('./webpack.config'); module.exports = { extends: '../../.eslintrc.js', + overrides: [ + { + files: ['*.ts', '*.tsx'], + rules: { + 'react/prop-types': 'off', + }, + }, + ], settings: { react: { version: '16', diff --git a/packages/components/package.json b/packages/components/package.json index a305e9ad9577..a86634a87a29 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -15,7 +15,7 @@ "build:icons-manifest": "node -e 'require(\"./utils/build-icons-manifest\").buildIconsManifest()'", "build:travis": "rimraf lib && webpack --mode=production", "test": "node \"./src/components/icon/__tests__/icons.js\"", - "test:eslint": "eslint \"./src/**/*.?(js|jsx|ts|tsx)\"", + "test:eslint": "eslint \"./src/**/*.?(js|jsx)\"", "deploy": "echo \"No deploy specified\"", "deploy:clean": "echo \"No deploy:clean specified\"", "deploy:folder": "echo \"No deploy:folder specified\"",