diff --git a/.eslintrc.js b/.eslintrc.js
deleted file mode 100644
index 8d788f7e..00000000
--- a/.eslintrc.js
+++ /dev/null
@@ -1,18 +0,0 @@
-module.exports = {
- root: true,
- parser: '@typescript-eslint/parser',
- plugins: ['@typescript-eslint'],
- extends: [
- 'eslint:recommended',
- 'plugin:@typescript-eslint/recommended',
- 'prettier',
- ],
- overrides: [
- {
- files: ['**/*.test.ts', '**/test/**/*.ts'],
- rules: {
- '@typescript-eslint/ban-ts-comment': ['off'],
- },
- },
- ],
-};
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2c537c94..f200e74e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -22,7 +22,7 @@ jobs:
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- run: yarn --frozen-lockfile
- - run: yarn lint
+ - run: cd packages/backend && yarn lint
- run: echo "🍏 This job's status is ${{ job.status }}."
start-backend-server:
runs-on: ubuntu-latest
diff --git a/package.json b/package.json
index 83e33ab6..e8a5eb9f 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,6 @@
"start": "lerna run --stream --parallel --scope=@*/{web,backend} dev",
"start:web": "lerna run --stream --scope=@*/web dev",
"start:backend": "lerna run --stream --scope=@*/backend dev",
- "lint": "lerna run --no-bail --stream --parallel --scope=@*/{web,backend} lint",
"build:docs": "cd ./packages/docs && yarn install && yarn build"
},
"workspaces": {
@@ -21,8 +20,6 @@
]
},
"devDependencies": {
- "@typescript-eslint/eslint-plugin": "^5.9.1",
- "@typescript-eslint/parser": "^5.9.1",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
diff --git a/.eslintignore b/packages/backend/.eslintignore
similarity index 100%
rename from .eslintignore
rename to packages/backend/.eslintignore
diff --git a/packages/backend/package.json b/packages/backend/package.json
index 027525ff..b59b7e0f 100644
--- a/packages/backend/package.json
+++ b/packages/backend/package.json
@@ -11,7 +11,7 @@
"start:worker": "node src/worker.js",
"pretest": "APP_ENV=test node ./test/setup/prepare-test-env.js",
"test": "APP_ENV=test vitest run",
- "lint": "eslint . --ignore-path ../../.eslintignore",
+ "lint": "eslint .",
"db:create": "node ./bin/database/create.js",
"db:seed:user": "node ./bin/database/seed-user.js",
"db:drop": "node ./bin/database/drop.js",
@@ -95,7 +95,6 @@
"url": "https://github.com/automatisch/automatisch/issues"
},
"devDependencies": {
- "@typescript-eslint/utils": "^7.0.2",
"nodemon": "^2.0.13",
"supertest": "^6.3.3",
"vitest": "^1.1.3"
diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json
index c1b716ff..48d395e0 100644
--- a/packages/e2e-tests/package.json
+++ b/packages/e2e-tests/package.json
@@ -28,8 +28,6 @@
"@playwright/test": "^1.36.2"
},
"dependencies": {
- "@typescript-eslint/eslint-plugin": "^5.9.1",
- "@typescript-eslint/parser": "^5.9.1",
"dotenv": "^16.3.1",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.3.0",
diff --git a/packages/web/.eslintignore b/packages/web/.eslintignore
new file mode 100644
index 00000000..14672a63
--- /dev/null
+++ b/packages/web/.eslintignore
@@ -0,0 +1,3 @@
+node_modules
+build
+source
\ No newline at end of file
diff --git a/packages/web/.eslintrc.js b/packages/web/.eslintrc.js
new file mode 100644
index 00000000..1b79b16f
--- /dev/null
+++ b/packages/web/.eslintrc.js
@@ -0,0 +1,3 @@
+module.exports = {
+ extends: ['react-app', 'prettier'],
+};
diff --git a/packages/web/jsconfig.json b/packages/web/jsconfig.json
new file mode 100644
index 00000000..5875dc5b
--- /dev/null
+++ b/packages/web/jsconfig.json
@@ -0,0 +1,6 @@
+{
+ "compilerOptions": {
+ "baseUrl": "src"
+ },
+ "include": ["src"]
+}
diff --git a/packages/web/package.json b/packages/web/package.json
index 3f9a476c..201890a3 100644
--- a/packages/web/package.json
+++ b/packages/web/package.json
@@ -16,16 +16,9 @@
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
- "@types/jest": "^26.0.15",
- "@types/lodash": "^4.14.182",
- "@types/luxon": "^2.0.8",
- "@types/node": "^12.0.0",
- "@types/react": "^17.0.0",
- "@types/react-dom": "^17.0.0",
- "@types/react-window": "^1.8.5",
- "@types/uuid": "^9.0.0",
"clipboard-copy": "^4.0.1",
"compare-versions": "^4.1.3",
+ "eslint-plugin-react": "^7.33.2",
"graphql": "^15.6.0",
"lodash": "^4.17.21",
"luxon": "^2.3.1",
@@ -42,7 +35,6 @@
"slate": "^0.94.1",
"slate-history": "^0.93.0",
"slate-react": "^0.94.2",
- "typescript": "^4.6.3",
"uuid": "^9.0.0",
"web-vitals": "^1.0.1",
"yup": "^0.32.11"
@@ -54,7 +46,7 @@
"build:watch": "yarn nodemon --exec react-scripts build --watch 'src/**/*.ts' --watch 'public/**/*' --ext ts,html",
"test": "react-scripts test",
"eject": "react-scripts eject",
- "lint": "eslint . --ignore-path ../../.eslintignore",
+ "lint": "eslint .",
"prepack": "REACT_APP_GRAPHQL_URL=/graphql yarn build"
},
"files": [
@@ -87,5 +79,15 @@
},
"publishConfig": {
"access": "public"
+ },
+ "devDependencies": {
+ "eslint-config-prettier": "^9.1.0",
+ "eslint-config-react-app": "^7.0.1",
+ "prettier": "^3.2.5"
+ },
+ "eslintConfig": {
+ "extends": [
+ "./.eslintrc.js"
+ ]
}
}
diff --git a/packages/web/src/adminSettingsRoutes.tsx b/packages/web/src/adminSettingsRoutes.jsx
similarity index 99%
rename from packages/web/src/adminSettingsRoutes.tsx
rename to packages/web/src/adminSettingsRoutes.jsx
index ae59a296..340a92ed 100644
--- a/packages/web/src/adminSettingsRoutes.tsx
+++ b/packages/web/src/adminSettingsRoutes.jsx
@@ -8,12 +8,10 @@ import CreateRole from 'pages/CreateRole/index.ee';
import EditRole from 'pages/EditRole/index.ee';
import Authentication from 'pages/Authentication';
import UserInterface from 'pages/UserInterface';
-
import * as URLS from 'config/urls';
import Can from 'components/Can';
import AdminApplications from 'pages/AdminApplications';
import AdminApplication from 'pages/AdminApplication';
-
// TODO: consider introducing redirections to `/` as fallback
export default (
<>
diff --git a/packages/web/src/components/AccountDropdownMenu/index.tsx b/packages/web/src/components/AccountDropdownMenu/index.jsx
similarity index 79%
rename from packages/web/src/components/AccountDropdownMenu/index.tsx
rename to packages/web/src/components/AccountDropdownMenu/index.jsx
index 849b93c0..17c31d8c 100644
--- a/packages/web/src/components/AccountDropdownMenu/index.tsx
+++ b/packages/web/src/components/AccountDropdownMenu/index.jsx
@@ -1,40 +1,24 @@
import * as React from 'react';
import { useNavigate } from 'react-router-dom';
import MenuItem from '@mui/material/MenuItem';
-import Menu, { MenuProps } from '@mui/material/Menu';
+import Menu from '@mui/material/Menu';
import { Link } from 'react-router-dom';
-
import Can from 'components/Can';
import apolloClient from 'graphql/client';
import * as URLS from 'config/urls';
import useAuthentication from 'hooks/useAuthentication';
import useFormatMessage from 'hooks/useFormatMessage';
-
-type AccountDropdownMenuProps = {
- open: boolean;
- onClose: () => void;
- anchorEl: MenuProps['anchorEl'];
- id: string;
-};
-
-function AccountDropdownMenu(
- props: AccountDropdownMenuProps
-): React.ReactElement {
+function AccountDropdownMenu(props) {
const formatMessage = useFormatMessage();
const authentication = useAuthentication();
const navigate = useNavigate();
-
const { open, onClose, anchorEl, id } = props;
-
const logout = async () => {
authentication.updateToken('');
await apolloClient.clearStore();
-
onClose();
-
navigate(URLS.LOGIN);
};
-
return (
);
}
-
export default AccountDropdownMenu;
diff --git a/packages/web/src/components/AddAppConnection/index.tsx b/packages/web/src/components/AddAppConnection/index.jsx
similarity index 82%
rename from packages/web/src/components/AddAppConnection/index.tsx
rename to packages/web/src/components/AddAppConnection/index.jsx
index 3a7febd3..87db10bf 100644
--- a/packages/web/src/components/AddAppConnection/index.tsx
+++ b/packages/web/src/components/AddAppConnection/index.jsx
@@ -1,4 +1,3 @@
-import type { IApp, IField, IJSONObject } from 'types';
import LoadingButton from '@mui/lab/LoadingButton';
import Alert from '@mui/material/Alert';
import Dialog from '@mui/material/Dialog';
@@ -6,32 +5,21 @@ import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import * as React from 'react';
-import { FieldValues, SubmitHandler } from 'react-hook-form';
import { useNavigate, useSearchParams } from 'react-router-dom';
-
import AppAuthClientsDialog from 'components/AppAuthClientsDialog/index.ee';
import InputCreator from 'components/InputCreator';
import * as URLS from 'config/urls';
import useAuthenticateApp from 'hooks/useAuthenticateApp.ee';
import useFormatMessage from 'hooks/useFormatMessage';
-import { generateExternalLink } from '../../helpers/translationValues';
+import { generateExternalLink } from 'helpers/translationValues';
import { Form } from './style';
-
-type AddAppConnectionProps = {
- onClose: (response: Record) => void;
- application: IApp;
- connectionId?: string;
-};
-
-export default function AddAppConnection(
- props: AddAppConnectionProps
-): React.ReactElement {
+export default function AddAppConnection(props) {
const { application, connectionId, onClose } = props;
const { name, authDocUrl, key, auth } = application;
const navigate = useNavigate();
const [searchParams] = useSearchParams();
const formatMessage = useFormatMessage();
- const [error, setError] = React.useState(null);
+ const [error, setError] = React.useState(null);
const [inProgress, setInProgress] = React.useState(false);
const hasConnection = Boolean(connectionId);
const useShared = searchParams.get('shared') === 'true';
@@ -42,7 +30,6 @@ export default function AddAppConnection(
appAuthClientId,
useShared: !!appAuthClientId,
});
-
React.useEffect(function relayProviderData() {
if (window.opener) {
window.opener.postMessage({
@@ -52,51 +39,41 @@ export default function AddAppConnection(
window.close();
}
}, []);
-
React.useEffect(
function initiateSharedAuthenticationForGivenAuthClient() {
if (!appAuthClientId) return;
if (!authenticate) return;
-
const asyncAuthenticate = async () => {
await authenticate();
-
navigate(URLS.APP_CONNECTIONS(key));
};
-
asyncAuthenticate();
},
- [appAuthClientId, authenticate]
+ [appAuthClientId, authenticate],
);
-
- const handleClientClick = (appAuthClientId: string) =>
+ const handleClientClick = (appAuthClientId) =>
navigate(URLS.APP_ADD_CONNECTION_WITH_AUTH_CLIENT_ID(key, appAuthClientId));
-
const handleAuthClientsDialogClose = () =>
navigate(URLS.APP_CONNECTIONS(key));
-
- const submitHandler: SubmitHandler = React.useCallback(
+ const submitHandler = React.useCallback(
async (data) => {
if (!authenticate) return;
-
setInProgress(true);
-
try {
const response = await authenticate({
fields: data,
});
- onClose(response as Record);
+ onClose(response);
} catch (err) {
- const error = err as IJSONObject;
+ const error = err;
console.log(error);
- setError((error.graphQLErrors as IJSONObject[])?.[0]);
+ setError(error.graphQLErrors?.[0]);
} finally {
setInProgress(false);
}
},
- [authenticate]
+ [authenticate],
);
-
if (useShared)
return (
);
-
if (appAuthClientId) return ;
-
return (