Bumped vite, eslint, typescript, prettier and related plugins versions to latest (#623)

* Bumped vite, eslint, typescript, prettier and related plugins

* Fixed unused arg

* Fixed prettier warnings
This commit is contained in:
yuri-sakharov
2025-11-22 08:31:28 +02:00
committed by GitHub
parent 40161aee12
commit 210a371d06
32 changed files with 3837 additions and 3287 deletions

View File

@@ -1,44 +0,0 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: ["enpitech", "plugin:@typescript-eslint/recommended"],
globals: {
heap: "writable",
DD_RUM: "writable",
},
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
},
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react"],
rules: {
// please don't make an error occur here we use console.error
"no-console": ["error", { allow: ["error"] }],
"no-alert": "error",
"no-debugger": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{ vars: "all", args: "after-used", ignoreRestSiblings: true },
],
"react/react-in-jsx-scope": "off", // Vite does not require you to import React into each component file
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"@typescript-eslint/no-explicit-any": "warn",
},
};

View File

@@ -0,0 +1,85 @@
const {
defineConfig,
} = require("eslint/config");
const globals = require("globals");
const tsParser = require("@typescript-eslint/parser");
const typescriptEslint = require("@typescript-eslint/eslint-plugin");
const react = require("eslint-plugin-react");
const js = require("@eslint/js");
const {
FlatCompat,
} = require("@eslint/eslintrc");
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
module.exports = defineConfig([{
languageOptions: {
globals: {
...globals.browser,
heap: "writable",
DD_RUM: "writable",
},
parser: tsParser,
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
ecmaFeatures: { jsx: true },
project: "./tsconfig.json",
},
},
extends: compat.extends("enpitech", "plugin:@typescript-eslint/recommended"),
plugins: {
"@typescript-eslint": typescriptEslint,
react,
},
settings: {
react: {
version: "detect"
},
},
rules: {
"no-console": ["error", {
allow: ["error"],
}],
"no-alert": "error",
"no-debugger": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": ["error", {
vars: "all",
args: "after-used",
ignoreRestSiblings: true,
}],
"react/react-in-jsx-scope": "off",
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"@typescript-eslint/no-explicit-any": "warn",
},
}, {
languageOptions: {
globals: {
...globals.node,
},
sourceType: "script",
parserOptions: {},
},
files: ["**/.eslintrc.{js,cjs}"],
}]);

File diff suppressed because it is too large Load Diff

View File

@@ -10,7 +10,6 @@
"@types/marked": "^5.0.0", "@types/marked": "^5.0.0",
"compare-versions": "^6.0.0-rc.2", "compare-versions": "^6.0.0-rc.2",
"diff2html": "^3.4.46", "diff2html": "^3.4.46",
"eslint-config-enpitech": "^1.0.9",
"flowbite": "^1.6.6", "flowbite": "^1.6.6",
"flowbite-react": "^0.4.9", "flowbite-react": "^0.4.9",
"highlight.js": "^11.8.0", "highlight.js": "^11.8.0",
@@ -26,11 +25,12 @@
"react-router-dom": "^6.9.0", "react-router-dom": "^6.9.0",
"react-select": "^5.7.4", "react-select": "^5.7.4",
"swagger-ui-react": "^5.1.1", "swagger-ui-react": "^5.1.1",
"uuid": "^9.0.1", "uuid": "^9.0.1"
"vite-plugin-static-copy": "^2.3.2"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.0", "@babel/core": "^7.21.0",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.39.1",
"@storybook/addon-actions": "^7.0.24", "@storybook/addon-actions": "^7.0.24",
"@storybook/addon-essentials": "^8.6.14", "@storybook/addon-essentials": "^8.6.14",
"@storybook/addon-interactions": "^7.0.24", "@storybook/addon-interactions": "^7.0.24",
@@ -45,24 +45,27 @@
"@types/react-dom": "^18.0.10", "@types/react-dom": "^18.0.10",
"@types/swagger-ui-react": "^4.18.0", "@types/swagger-ui-react": "^4.18.0",
"@types/uuid": "^9.0.4", "@types/uuid": "^9.0.4",
"@typescript-eslint/eslint-plugin": "^6.2.1", "@typescript-eslint/eslint-plugin": "^8.47.0",
"@typescript-eslint/parser": "^6.2.1", "@typescript-eslint/parser": "^8.47.0",
"@vitejs/plugin-react": "^5.0.4", "@vitejs/plugin-react": "^5.1.1",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"cypress": "^13.3.0", "cypress": "^13.3.0",
"eslint": "^8.46.0", "eslint": "^9.39.1",
"eslint-config-prettier": "^8.7.0", "eslint-config-enpitech": "^1.0.17",
"eslint-plugin-react": "^7.33.1", "eslint-config-prettier": "^10.1.8",
"eslint-plugin-storybook": "^0.6.12", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-storybook": "^10.0.8",
"globals": "^16.5.0",
"lint-staged": "^13.2.3", "lint-staged": "^13.2.3",
"postcss": "^8.4.24", "postcss": "^8.4.24",
"prettier": "2.8.4", "prettier": "^3.6.2",
"react-icons": "^4.8.0", "react-icons": "^4.8.0",
"storybook": "9.1.13", "storybook": "9.1.13",
"tailwindcss": "^3.3.2", "tailwindcss": "^3.3.2",
"typescript": "^4.9.5", "typescript": "^5.9.3",
"vite": "^7.1.11", "vite": "^7.2.4",
"vite-plugin-html-config": "^1.0.11" "vite-plugin-html-config": "^2.0.2",
"vite-plugin-static-copy": "^3.1.4"
}, },
"lint-staged": { "lint-staged": {
"**/*": "prettier --write --ignore-unknown" "**/*": "prettier --write --ignore-unknown"

View File

@@ -143,7 +143,7 @@ class ApiService {
}: { }: {
queryKey: [ queryKey: [
string, string,
{ namespace: string; chart: { name: string }; version: number } { namespace: string; chart: { name: string }; version: number },
]; ];
}) => { }) => {
const [, params] = queryKey; const [, params] = queryKey;

View File

@@ -14,7 +14,7 @@
* @see https://storybook.js.org/docs/react/writing-stories/introduction * @see https://storybook.js.org/docs/react/writing-stories/introduction
*/ */
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import Badge from "./Badge"; import Badge from "./Badge";
// We set the metadata for the story. // We set the metadata for the story.

View File

@@ -1,4 +1,4 @@
import { Meta, StoryObj } from "@storybook/react"; import { Meta, StoryObj } from "@storybook/react-vite";
import Button from "./Button"; import Button from "./Button";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta, StoryObj } from "@storybook/react"; import { Meta, StoryObj } from "@storybook/react-vite";
import ClustersList from "./ClustersList"; import ClustersList from "./ClustersList";
const meta = { const meta = {

View File

@@ -11,10 +11,9 @@ const HealthStatus = ({ statusData }: Props) => {
return item.status?.conditions return item.status?.conditions
?.filter((cond) => cond.type === HD_RESOURCE_CONDITION_TYPE) ?.filter((cond) => cond.type === HD_RESOURCE_CONDITION_TYPE)
.map((cond) => { .map((cond) => {
const stableKey = const stableKey = item.metadata?.uid
item.metadata?.uid ? `${item.metadata.uid}-${item.metadata.namespace ?? "default"}`
? `${item.metadata.uid}-${item.metadata.namespace ?? "default"}` : `${item.kind}-${item.metadata?.namespace ?? "default"}-${item.metadata?.name}`;
: `${item.kind}-${item.metadata?.namespace ?? "default"}-${item.metadata?.name}`;
return ( return (
<Tooltip <Tooltip
@@ -26,20 +25,20 @@ const HealthStatus = ({ statusData }: Props) => {
cond.status === "Healthy" cond.status === "Healthy"
? "bg-success" ? "bg-success"
: cond.status === "Progressing" : cond.status === "Progressing"
? "bg-warning" ? "bg-warning"
: "bg-danger" : "bg-danger"
} w-2.5 h-2.5 rounded-sm`} } w-2.5 h-2.5 rounded-sm`}
></span> ></span>
</Tooltip> </Tooltip>
); );
}); });
}); });
if (statuses.length === 0) { if (statuses.length === 0) {
return <div>No health statuses available</div>; return <div>No health statuses available</div>;
} }
return <div className="flex flex-wrap gap-1">{statuses}</div>; return <div className="flex flex-wrap gap-1">{statuses}</div>;
}; };
export default HealthStatus; export default HealthStatus;

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import InstalledPackageCard from "./InstalledPackageCard"; import InstalledPackageCard from "./InstalledPackageCard";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import InstalledPackagesHeader from "./InstalledPackagesHeader"; import InstalledPackagesHeader from "./InstalledPackagesHeader";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import InstalledPackagesList from "./InstalledPackagesList"; import InstalledPackagesList from "./InstalledPackagesList";
const meta = { const meta = {

View File

@@ -6,7 +6,7 @@
* The default story renders the component with the default props. * The default story renders the component with the default props.
*/ */
import { Meta, StoryObj } from "@storybook/react"; import { Meta, StoryObj } from "@storybook/react-vite";
import { action } from "@storybook/addon-actions"; import { action } from "@storybook/addon-actions";
import SelectMenu, { SelectMenuItem } from "./SelectMenu"; import SelectMenu, { SelectMenuItem } from "./SelectMenu";

View File

@@ -1,4 +1,4 @@
import { StoryFn, Meta } from "@storybook/react"; import { StoryFn, Meta } from "@storybook/react-vite";
import ShutDownButton from "./ShutDownButton"; import ShutDownButton from "./ShutDownButton";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import Tabs from "./Tabs"; import Tabs from "./Tabs";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import TabsBar from "./TabsBar"; import TabsBar from "./TabsBar";
const meta = { const meta = {

View File

@@ -4,7 +4,7 @@
* the first story simply renders the component with the default props. * the first story simply renders the component with the default props.
*/ */
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import TextInput from "./TextInput"; import TextInput from "./TextInput";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta, StoryFn } from "@storybook/react"; import { Meta, StoryFn } from "@storybook/react-vite";
import { Troubleshoot } from "./Troubleshoot"; import { Troubleshoot } from "./Troubleshoot";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import { Button } from "./Button"; import { Button } from "./Button";

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import { action } from "@storybook/addon-actions"; import { action } from "@storybook/addon-actions";
import DropDown from "./DropDown"; import DropDown from "./DropDown";
import { BsSlack, BsGithub } from "react-icons/bs"; import { BsSlack, BsGithub } from "react-icons/bs";

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import { Header } from "./Header"; import { Header } from "./Header";

View File

@@ -1,4 +1,4 @@
import { Meta, StoryObj } from "@storybook/react"; import { Meta, StoryObj } from "@storybook/react-vite";
import { within, userEvent } from "@storybook/testing-library"; import { within, userEvent } from "@storybook/testing-library";
import { Page } from "./Page"; import { Page } from "./Page";

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import StatusLabel, { DeploymentStatus } from "./StatusLabel"; import StatusLabel, { DeploymentStatus } from "./StatusLabel";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { StoryFn, Meta } from "@storybook/react"; import { StoryFn, Meta } from "@storybook/react-vite";
import AddRepositoryModal from "./AddRepositoryModal"; import AddRepositoryModal from "./AddRepositoryModal";
const meta = { const meta = {

View File

@@ -1,5 +1,5 @@
import { action } from "@storybook/addon-actions"; import { action } from "@storybook/addon-actions";
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import ErrorModal from "./ErrorModal"; import ErrorModal from "./ErrorModal";
const meta = { const meta = {

View File

@@ -1,5 +1,5 @@
import { action } from "@storybook/addon-actions"; import { action } from "@storybook/addon-actions";
import { StoryObj, StoryFn, Meta } from "@storybook/react"; import { StoryObj, StoryFn, Meta } from "@storybook/react-vite";
import Modal, { ModalAction, ModalButtonStyle } from "./Modal"; import Modal, { ModalAction, ModalButtonStyle } from "./Modal";
const meta = { const meta = {

View File

@@ -1,4 +1,4 @@
import { Meta } from "@storybook/react"; import { Meta } from "@storybook/react-vite";
import ChartViewer from "./ChartViewer"; import ChartViewer from "./ChartViewer";
//👇 This default export determines where your story goes in the story list //👇 This default export determines where your story goes in the story list

View File

@@ -1,4 +1,4 @@
import { StoryFn, Meta } from "@storybook/react"; import { StoryFn, Meta } from "@storybook/react-vite";
import RepositoriesList from "./RepositoriesList"; import RepositoriesList from "./RepositoriesList";
const meta = { const meta = {
@@ -17,7 +17,6 @@ const Template: StoryFn<typeof RepositoriesList> = () => (
<RepositoriesList <RepositoriesList
selectedRepository={undefined} selectedRepository={undefined}
// in this case we allow Unexpected empty method // in this case we allow Unexpected empty method
//eslint-disable-next-line @typescript-eslint/no-empty-function
onRepositoryChanged={() => {}} onRepositoryChanged={() => {}}
repositories={[]} repositories={[]}
/> />

View File

@@ -1,4 +1,4 @@
import { StoryFn, Meta } from "@storybook/react"; import { StoryFn, Meta } from "@storybook/react-vite";
import RepositoryViewer from "./RepositoryViewer"; import RepositoryViewer from "./RepositoryViewer";
const meta = { const meta = {

View File

@@ -12,6 +12,5 @@ export const ErrorModalContext = createContext<{
}>({ }>({
shouldShowErrorModal: undefined, shouldShowErrorModal: undefined,
// in this case we allow Unexpected empty method // in this case we allow Unexpected empty method
//eslint-disable-next-line @typescript-eslint/no-empty-function setShowErrorModal: () => {},
setShowErrorModal: (toggle?: ErrorAlert) => {},
}); });

View File

@@ -66,7 +66,7 @@ export type ReleaseHealthStatus = {
lastProbeTime: string; lastProbeTime: string;
lastTransitionTime?: string; lastTransitionTime?: string;
reason: string; reason: string;
} },
]; ];
}; };
}; };

File diff suppressed because it is too large Load Diff