Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: updated all dependencies to the latest version #45

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .eslintrc.json

This file was deleted.

35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import sonarJs from "eslint-plugin-sonarjs";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import pluginSecurity from "eslint-plugin-security";

export default [
{ files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
sonarJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
eslintPluginPrettierRecommended,
pluginSecurity.configs.recommended,
{
ignores: [
".next/",
"node_modules/",
"out/",
"**/*.min.js",
"**/vendor/*.js",
"public/*",
".storybook/",
"**/*.test.ts",
"**/*.styles.ts",
"src/themes/**",
"*.setup.js",
"*.config.js",
"lighthouserc.js",
],
},
];
100 changes: 54 additions & 46 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"dev": "cross-env NODE_ENV=development next dev",
"build": "yarn lingui:build && next build",
"start": "cross-env NODE_ENV=production next start",
"lint": "next lint",
"lint": "eslint .",
"lint:staged": "lint-staged",
"prepare": "husky install",
"test": "yarn lingui:build && cross-env NODE_ENV=test jest --coverage",
"test:watch": "jest --env=jsdom --watch",
"test:coverage": "jest --env=jsdom --coverage",
"prettify": "prettier --write ./**/*.ts",
"lint:eslint:fix": "yarn eslint . --ext .ts,.tsx --fix",
"lint:fix": "yarn eslint . --fix",
"analyze": "cross-env ANALYZE=true yarn build",
"analyze:server": "cross-env BUNDLE_ANALYZE=server next build",
"analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build",
Expand All @@ -21,75 +21,83 @@
"lingui:build": "yarn lingui:extract && yarn lingui:compile"
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@lingui/react": "^4.6.0",
"@lingui/macro": "^4.6.0",
"@mui/material": "^5.15.0",
"@mui/material-nextjs": "^5.15.0",
"@next/bundle-analyzer": "^14.0.4",
"@reduxjs/toolkit": "^2.0.1",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@lingui/macro": "^4.11.3",
"@lingui/react": "^4.11.3",
"@mui/material": "^6.0.0",
"@mui/material-nextjs": "^6.0.0",
"@next/bundle-analyzer": "^14.2.6",
"@reduxjs/toolkit": "^2.2.7",
"babel-plugin-import": "^1.13.3",
"cross-env": "^7.0.3",
"history": "^5.3.0",
"isomorphic-fetch": "^3.0.0",
"lodash-es": "^4.17.21",
"next": "13",
"next": "14.2.6",
"next-compose-plugins": "^2.2.1",
"next-redux-wrapper": "^8.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-redux": "^9.1.2",
"util": "^0.12.4"
},
"devDependencies": {
"@babel/core": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@babel/preset-typescript": "^7.23.3",
"@commitlint/cli": "^16.2.1",
"@commitlint/config-conventional": "^16.2.1",
"@ducanh2912/next-pwa": "^10.0.0",
"@emotion/jest": "^11.11.0",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/preset-typescript": "^7.24.7",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-conventional": "^19.2.2",
"@ducanh2912/next-pwa": "^10.2.8",
"@emotion/jest": "^11.13.0",
"@emotion/server": "^11.11.0",
"@lingui/cli": "^4.6.0",
"@lingui/loader": "^4.6.0",
"@lingui/swc-plugin": "^4.0.4",
"@testing-library/jest-dom": "^6.1.5",
"@testing-library/react": "^14.1.2",
"@types/isomorphic-fetch": "^0.0.36",
"@types/jest": "^29.5.10",
"@types/lodash": "^4.14.182",
"@eslint/eslintrc": "^3.1.0",
"eslint-config-prettier": "^9.1.0",
"@eslint/js": "^9.9.1",
"@lingui/cli": "^4.11.3",
"@lingui/loader": "^4.11.3",
"@lingui/swc-plugin": "^4.0.8",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.0",
"@types/isomorphic-fetch": "^0.0.39",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.7",
"@types/lodash-es": "^4.17.12",
"@types/node": "17.0.14",
"@types/prop-types": "^15.7.4",
"@types/react": "^18.2.42",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0",
"@welldone-software/why-did-you-render": "^7.0.1",
"@types/node": "22.5.0",
"@types/prop-types": "^15.7.12",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"@welldone-software/why-did-you-render": "^8.0.3",
"babel-jest": "^29.7.0",
"babel-plugin-module-resolver": "^4.1.0",
"babel-plugin-module-resolver": "^5.0.2",
"babel-plugin-react-remove-properties": "^0.3.0",
"babel-plugin-require-context-hook": "^1.0.0",
"babel-plugin-transform-dynamic-import": "^2.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-plugin-typescript-to-proptypes": "^2.0.0",
"eslint": "^8.8.0",
"eslint-config-next": "13",
"eslint-plugin-react": "^7.28.0",
"husky": "^7.0.4",
"eslint": "^9.9.1",
"eslint-config-next": "^14.2.7",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-security": "^3.0.1",
"eslint-plugin-sonarjs": "^2.0.1",
"globals": "^15.9.0",
"husky": "^9.1.5",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-sonar": "^0.2.16",
"jest-styled-components": "^7.2.0",
"lint-staged": "^12.3.3",
"next-router-mock": "^0.9.10",
"lint-staged": "^15.2.9",
"next-router-mock": "^0.9.13",
"pre-commit": "^1.2.2",
"prettier": "2.5.1",
"prettier": "^3.3.3",
"prop-types": "^15.8.1",
"ts-jest": "^29.1.1",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
"typescript": "^5.5.4",
"typescript-eslint": "^8.3.0"
}
}
1 change: 0 additions & 1 deletion src/common/ErrorBoundary/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
}

componentDidCatch(error, errorInfo) {
// eslint-disable-next-line no-console
console.error(error, errorInfo);
}

Expand All @@ -34,7 +33,7 @@
</h1>
);
}
return this.props.children;

Check failure on line 36 in src/common/ErrorBoundary/index.tsx

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

'children' is missing in props validation
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/common/For/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const For = ({
ParentComponent = FlexContainer,
renderItem,
noParent,
}: ForProps<typeof of[0], typeof ParentComponent>) => {
}: ForProps<(typeof of)[0], typeof ParentComponent>) => {
const list = () => of.map((item, index) => ({ ...renderItem(item, index), key: index }));
const children = () => (
<ParentComponent {...parentProps} data-testid="for">
Expand Down
14 changes: 7 additions & 7 deletions src/common/Loader/tests/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import { render } from '@testing-library/react';
import Loader from '../index';
import React from "react";
import { render } from "@testing-library/react";
import Loader from "../index";

describe('Loader component', () => {
it('renders without crashing', () => {
describe("Loader component", () => {
it("renders without crashing", () => {
render(<Loader />);
});

it('renders CircularProgress component', () => {
it("renders CircularProgress component", () => {
const { getByRole } = render(<Loader />);
const circularProgress = getByRole('progressbar');
const circularProgress = getByRole("progressbar");
expect(circularProgress).toBeDefined();
});
});
6 changes: 3 additions & 3 deletions src/containers/Repos/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const Repos: React.FC<RepoContainerProps> = ({ maxwidth }) => {
isEmpty(repoName)
? skipToken
: {
repoName,
page,
},
repoName,
page,
},
{ skip: router.isFallback }
);

Expand Down
5 changes: 4 additions & 1 deletion src/features/repos/components/ErrorState/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ const ErrorState: React.FC<ErrorStateProps> = ({ reposData, reposError, loading
repoError = t`Search Default`;
}
return !loading && repoError ? (
<CustomCard color={reposError ? `${theme.palette.error.main}` : `${theme.palette.customColor.main[500]}`} data-testid="error-state">
<CustomCard
color={reposError ? `${theme.palette.error.main}` : `${theme.palette.customColor.main[500]}`}
data-testid="error-state"
>
<T variant="subtitle2">
<Trans>Repository List</Trans>
</T>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import { GetStaticProps, Metadata, NextPage } from "next";
import { loadCatalog } from "@app/utils/linguiUtils";
import { Meta } from "@common";
import { Repos } from "@features/repos";
import { GetStaticProps, Metadata, NextPage } from "next";
import React from "react";

const metadata: Metadata = {
title: "Next.js TypeScript Template | Wednesday Solutions",
Expand Down
1 change: 0 additions & 1 deletion src/utils/createEmotionCache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import createCache from "@emotion/cache";


// On the client side, Create a meta tag at the top of the <head> and set it as insertionPoint.
// This assures that MUI styles are loaded first.
// It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
Expand Down
16 changes: 8 additions & 8 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
Array.isArray(obj)
? obj.map(val => mapKeysDeep(val, fn))
: typeof obj === "object"
? Object.keys(obj).reduce((acc, current) => {
const key = fn(current);
const val = obj[current];
acc[key] = val !== null && typeof val === "object" ? mapKeysDeep(val, fn) : val;
return acc;
}, {})
: obj;
? Object.keys(obj).reduce((acc, current) => {
const key = fn(current);
const val = obj[current];

Check warning on line 10 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

Variable Assigned to Object Injection Sink
acc[key] = val !== null && typeof val === "object" ? mapKeysDeep(val, fn) : val;

Check warning on line 11 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

Generic Object Injection Sink
return acc;
}, {})
: obj;

export const isLocal = () => {
try {
Expand All @@ -27,9 +27,9 @@
const queryString = {};
try {
keys.forEach(key => {
queryString[key] = decodeURIComponent(

Check warning on line 30 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

Generic Object Injection Sink
window.location.search.replace(
new RegExp(

Check warning on line 32 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

Found non-literal argument to RegExp Constructor
`^(?:.*[&\\?]${encodeURIComponent(key).replace(/[.+*]/g, "\\$&")}(?:\\=([^&]*))?)?.*$`,
"i"
),
Expand All @@ -37,7 +37,7 @@
)
);
});
// eslint-disable-next-line

Anurag-Wednesday marked this conversation as resolved.
Show resolved Hide resolved
return pickBy(queryString);
} catch (error) {
return null;
Expand All @@ -59,8 +59,8 @@
for (const key in obj) {
const camelKey = camelCase(key);
if (camelKey !== key) {
obj[camelKey] = obj[key];

Check warning on line 62 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

Generic Object Injection Sink

Check warning on line 62 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

Generic Object Injection Sink
delete obj[key];

Check warning on line 63 in src/utils/index.ts

View workflow job for this annotation

GitHub Actions / Build & Lint (20.x)

Generic Object Injection Sink
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/utils/testUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export const WithAllProviders: React.FC<{ children: React.ReactNode }> = ({ chil
return (
<ReduxProvider store={store}>
<I18nProvider i18n={i18n}>
<ThemeProvider theme={theme}>
{children}
</ThemeProvider>
<ThemeProvider theme={theme}>{children}</ThemeProvider>
</I18nProvider>
</ReduxProvider>
);
Expand Down
Loading
Loading