Skip to content

Commit

Permalink
Upgrade frontend dependencies (#3818)
Browse files Browse the repository at this point in the history
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
  • Loading branch information
cynthia-sg authored May 16, 2024
1 parent c786115 commit 8614592
Show file tree
Hide file tree
Showing 310 changed files with 2,619 additions and 1,823 deletions.
39 changes: 39 additions & 0 deletions web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// eslint.config.js

import js from '@eslint/js';
import reactHooks from 'eslint-plugin-react-hooks';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import tseslint from 'typescript-eslint';
import globals from "globals";

const config = [
js.configs.recommended,
...tseslint.configs.recommended,
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
plugins: {
'@typescript-eslint': tseslint.plugin,
'react-hooks': reactHooks,
'simple-import-sort': simpleImportSort,
},
ignores: ['analytics.ts', 'jsonschema.ts'],
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
...globals.browser,
},
},
},
];

export default config;
48 changes: 27 additions & 21 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"name": "hub",
"version": "1.18.0",
"private": true,
"type": "module",
"dependencies": {
"@analytics/google-analytics-v3": "^0.6.1",
"analytics": "^0.8.11",
"apexcharts": "^3.48.0",
"apexcharts": "^3.49.1",
"bootstrap": "^5.3.3",
"classnames": "^2.5.1",
"codemirror": "^5.65.15",
Expand All @@ -16,17 +17,17 @@
"json-schema-merge-allof": "^0.8.1",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"nanoid": "^4.0.2",
"react": "^18.1.0",
"nanoid": "^5.0.7",
"react": "^18.3.1",
"react-apexcharts": "^1.4.1",
"react-codemirror2": "^7.3.0",
"react-color": "^2.19.3",
"react-diff-view": "3.0.2",
"react-dom": "^18.1.0",
"react-icons": "^5.1.0",
"react-image-crop": "^10.1.8",
"react-dom": "^18.3.1",
"react-icons": "^5.2.0",
"react-image-crop": "^11.0.5",
"react-markdown": "^8.0.7",
"react-router-dom": "^6.22.3",
"react-router-dom": "^6.23.1",
"react-syntax-highlighter": "^15.5.0",
"regexify-string": "^1.0.17",
"remark-gfm": "^3.0.1",
Expand All @@ -37,47 +38,52 @@
"tinycolor2": "^1.6.0",
"ua-parser-js": "^1.0.37",
"unified": "^10.1.2",
"yaml": "^2.4.1"
"yaml": "^2.4.2"
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "14.2.1",
"@eslint/js": "^9.2.0",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^15.0.7",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.5.2",
"@types/bootstrap": "^5.2.10",
"@types/crypto-js": "^4.2.2",
"@types/jest": "^29.5.12",
"@types/json-schema": "^7.0.14",
"@types/json-schema-merge-allof": "^0.6.5",
"@types/lodash": "^4.17.0",
"@types/node": "^20.12.7",
"@types/react": "^18.2.78",
"@types/lodash": "^4.17.1",
"@types/node": "^20.12.12",
"@types/react": "^18.3.2",
"@types/react-color": "^3.0.12",
"@types/react-dom": "^18.2.25",
"@types/react-syntax-highlighter": "^15.5.11",
"@types/react-dom": "^18.3.0",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/semver": "^7.5.8",
"eslint": "^9.2.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.0",
"globals": "^15.2.0",
"jest-fetch-mock": "^3.0.3",
"jest-mock": "^29.7.0",
"prettier": "^3.2.5",
"react-scripts": "^5.0.1",
"sass": "^1.75.0",
"sass": "^1.77.1",
"shx": "^0.3.4",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"typescript-eslint": "^7.9.0"
},
"proxy": "http://localhost:8000",
"scripts": {
"copy:static": "shx rm -rf src/static && shx mkdir src/static && shx cp -r public/static/* src/static",
"start": "yarn copy:static && DANGEROUSLY_DISABLE_HOST_CHECK=true react-scripts start",
"build": "yarn copy:static && INLINE_RUNTIME_CHUNK=false IMAGE_INLINE_SIZE_LIMIT=0 react-scripts build",
"start": "yarn copy:static && DANGEROUSLY_DISABLE_HOST_CHECK=true DISABLE_ESLINT_PLUGIN=true react-scripts start",
"build": "yarn copy:static && INLINE_RUNTIME_CHUNK=false IMAGE_INLINE_SIZE_LIMIT=0 DISABLE_ESLINT_PLUGIN=true react-scripts build",
"test": "sed -i -e 's/const FORCE_EXIT_DELAY = 500;/const FORCE_EXIT_DELAY = 1000;/g' ./node_modules/jest-worker/build/base/BaseWorkerPool.js && TZ=UTC react-scripts test # See https://github.com/facebook/jest/issues/11354",
"test:coverage": "TZ=UTC react-scripts test --coverage --watchAll=false",
"eject": "react-scripts eject",
"lint": "eslint --ext .js,.jsx,.ts,.tsx src --color",
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx src --fix",
"lint": "eslint src --max-warnings 0",
"lint:fix": "eslint src --max-warnings 0 --fix",
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"format:diff": "prettier --list-different \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"",
"isready": "yarn format && yarn lint && yarn test --watchAll=false --passWithNoTests --verbose && yarn build"
Expand Down
6 changes: 3 additions & 3 deletions web/src/analytics/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// @ts-ignore
// @ts-expect-error no d.ts file for this package
import googleAnalyticsV3 from '@analytics/google-analytics-v3';
import Analytics, { AnalyticsPlugin } from 'analytics';
import { isNull } from 'lodash';
import isNull from 'lodash/isNull';

import getMetaTag from '../utils/getMetaTag';

const getPlugins = (): AnalyticsPlugin[] => {
let plugins: AnalyticsPlugin[] = [];
const plugins: AnalyticsPlugin[] = [];
const analyticsConfig: string | null = getMetaTag('gaTrackingID');

if (!isNull(analyticsConfig) && analyticsConfig !== '' && analyticsConfig !== '{{ .gaTrackingID }}') {
Expand Down
2 changes: 2 additions & 0 deletions web/src/api/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ import renameKeysInObject from '../utils/renameKeysInObject';
import API from './index';
enableFetchMocks();

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const getData = (fixtureId: string): any => {
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-explicit-any
return require(`./__fixtures__/index/${fixtureId}.json`) as any;
};

Expand Down
Loading

0 comments on commit 8614592

Please sign in to comment.