From e67dfee554381b82a7ca58f9b93c36cf6380895e Mon Sep 17 00:00:00 2001 From: Hardy Jones <88002054+joneshf-dd@users.noreply.github.com> Date: Fri, 10 Dec 2021 14:01:54 -0800 Subject: [PATCH] UIAPPS-78 Fix `format`, `lint`, and `test` scripts This at least should get CI passing again. There are a couple parts to this. First, the `examples/sentiment` package didn't have either a `format` or `lint` script. We add a `format` script (but don't run it), and a `lint` script that exits with 0. The code style in the `examples/sentiment` package doesn't match up with the rest of this repo, so it will have to be fixed before we add an actual `lint` script that does something useful. Another part of this is that the `lint` script for `packages/ui-extensions-sdk` broke after pulling in the code from the `apps` repo. It's unclear why, but `eslint-plugin-prettier` seems to have some issue with being in a monorepo when run under yarn v1 and not at the top-level: https://github.com/prettier/eslint-plugin-prettier/issues/396. While we could upgrade to yarn v3, we hold off on making that change at the moment. Finally, we add a few ignore files so the format/lint scripts are useful in development (where there might be artifacts in the respective directories). --- examples/sentiment/.eslintignore | 1 + examples/sentiment/.prettierignore | 1 + examples/sentiment/package.json | 4 +++- package.json | 5 ++++- packages/ui-extensions-sdk/.eslintignore | 1 + packages/ui-extensions-sdk/.prettierignore | 1 + packages/ui-extensions-sdk/package.json | 1 - 7 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 examples/sentiment/.eslintignore create mode 100644 examples/sentiment/.prettierignore create mode 100644 packages/ui-extensions-sdk/.eslintignore create mode 100644 packages/ui-extensions-sdk/.prettierignore diff --git a/examples/sentiment/.eslintignore b/examples/sentiment/.eslintignore new file mode 100644 index 00000000..378eac25 --- /dev/null +++ b/examples/sentiment/.eslintignore @@ -0,0 +1 @@ +build diff --git a/examples/sentiment/.prettierignore b/examples/sentiment/.prettierignore new file mode 100644 index 00000000..378eac25 --- /dev/null +++ b/examples/sentiment/.prettierignore @@ -0,0 +1 @@ +build diff --git a/examples/sentiment/package.json b/examples/sentiment/package.json index 7f756ecc..2fd42af0 100644 --- a/examples/sentiment/package.json +++ b/examples/sentiment/package.json @@ -13,7 +13,9 @@ "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "test": "react-scripts test", + "format": "prettier --write .", + "lint": "echo TODO: Add lint script", + "test": "react-scripts test --passWithNoTests --watchAll=false", "eject": "react-scripts eject" }, "eslintConfig": { diff --git a/package.json b/package.json index a0085471..6e0167c9 100644 --- a/package.json +++ b/package.json @@ -17,5 +17,8 @@ "workspaces": [ "examples/*", "packages/*" - ] + ], + "devDependencies": { + "eslint-plugin-prettier": "3.1.4" + } } diff --git a/packages/ui-extensions-sdk/.eslintignore b/packages/ui-extensions-sdk/.eslintignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/ui-extensions-sdk/.eslintignore @@ -0,0 +1 @@ +dist diff --git a/packages/ui-extensions-sdk/.prettierignore b/packages/ui-extensions-sdk/.prettierignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/packages/ui-extensions-sdk/.prettierignore @@ -0,0 +1 @@ +dist diff --git a/packages/ui-extensions-sdk/package.json b/packages/ui-extensions-sdk/package.json index 41cef240..509e1567 100644 --- a/packages/ui-extensions-sdk/package.json +++ b/packages/ui-extensions-sdk/package.json @@ -46,7 +46,6 @@ "eslint-plugin-import": "2.22.1", "eslint-plugin-jest": "24.1.0", "eslint-plugin-no-storage": "1.0.2", - "eslint-plugin-prettier": "3.1.4", "express": "^4.17.1", "jest": "^26.6.2", "prettier": "2.1.2",