Skip to content

Commit

Permalink
sonar lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeparticle committed Nov 24, 2023
1 parent 910a88b commit 8de28bd
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 25 deletions.
4 changes: 2 additions & 2 deletions ui/src/api/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ async function makeRequest(url: string, method = "GET", data = null) {
if (url.includes(".json")) {
return await response.json();
}
if (contentType && contentType.includes("application/json")) {
if (contentType?.includes("application/json")) {
return await response.json();
} else if (contentType && contentType.includes("application/xml")) {
} else if (contentType?.includes("application/xml")) {
return await response.text();
} else {
return await response.text();
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/General/ColorPickerWithInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Card } from "antd";
import { ResponsiveInputWithLabel } from "components/General";
import { ColorPicker as CP } from "@mantine/core";
import { ColorPicker as Cp } from "@mantine/core";
import style from "./ColorPickerWithInput.module.scss";

interface ColorPickerWithInputProps {
Expand All @@ -27,7 +27,7 @@ const ColorPickerWithInput: React.FC<ColorPickerWithInputProps> = ({
<div className={style.cpwi__color}>
<Card size="small" style={{ background: value }} />
<div className={style.cpwi__color_dp}>
<CP
<Cp
format="rgba"
value={value}
onChange={setColor}
Expand Down
2 changes: 0 additions & 2 deletions ui/src/components/General/FallbackComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ const FallbackComponent: React.FC = () => {
<Alert
message={"Something went wrong"}
description={
<>
<Button
onClick={() =>
window.location.assign(window.location.pathname)
}
>
Refresh
</Button>
</>
}
type="error"
showIcon
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import style from "components/General/Notification/Notification.module.scss";
import { Button, Skeleton } from "antd";
import { Typography, Tag, Dropdown } from "antd";
import { Button, Skeleton, Typography, Tag, Dropdown } from "antd";
import { Icon, Markdown } from "components/General";
import { classNames } from "utils/helper-functions/string";
const { Title } = Typography;
Expand Down
1 change: 0 additions & 1 deletion ui/src/components/General/ResponsiveButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// import withSize from "components/Hoc/withSize";
import React from "react";
import { withSize } from "components/Hoc";
import { Button as AntButton } from "antd";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Avatar, Card, Skeleton, Space, Tag, Typography } from "antd";
import style from "./Resource.module.scss";
import { Clipboard } from "components/ComponentInjector";
import { Clipboard, ListItemProps } from "components/ComponentInjector";
import { ClipboardButton } from "components/InjectedComponent";
import { ListItemProps } from "components/ComponentInjector";

const { Title } = Typography;

Expand Down
1 change: 0 additions & 1 deletion ui/src/components/Layouts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ export { default as FloatingSearchBar } from "./FloatingSearchBar";
export { default as Header } from "./Header";
export { default as Legal } from "./Legal";
export { default as PageGrid } from "./PageGrid";
// export { getItem } from "./Menu/helper";
4 changes: 0 additions & 4 deletions ui/src/data/routeData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ export type RouteId =
| "data"
| "designsystem"
| "diagramming"
| "diagramming"
| "diffchecker"
| "diffchecker"
| "docs"
| "editor"
| "feedback"
| "feedback"
| "fileconverter"
| "github"
| "githubissue"
Expand All @@ -35,7 +32,6 @@ export type RouteId =
| "newsfeed"
| "npmpackages"
| "pagenotfound"
| "pagenotfound"
| "pixelconverter"
| "platform"
| "plugin"
Expand Down
4 changes: 1 addition & 3 deletions ui/src/pages/Newsfeed/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ function parseXML(value: string) {
const items = xmldoc.getElementsByTagName("item");
const list = [];

for (let i = 0; i < items.length; i++) {
const item = items[i];

for (const item of items) {
const title = item.getElementsByTagName("title")[0].textContent;
const description =
item.getElementsByTagName("description")[0].textContent;
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/Tools/CodeFormatter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const CodeFormatter: React.FC = () => {
try {
const options = {
indent_size: indentationLevel,
indent_with_tabs: indentationLevel === "tab" ? true : false,
indent_with_tabs: indentationLevel === "tab",
e4x: true,
};

Expand Down
6 changes: 1 addition & 5 deletions ui/src/pages/Tools/Diagramming/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ const Diagramming = () => {

const clearInputs = () => {
console.log("Element removed");
if (
btEcalidraw &&
btEcalidraw.elements &&
btEcalidraw.elements.length > 0
) {
if (btEcalidraw?.elements && btEcalidraw?.elements?.length > 0) {
const newElements = btEcalidraw.elements.slice(0, -1); // Remove the last element
setBtEcalidraw({
...btEcalidraw,
Expand Down

0 comments on commit 8de28bd

Please sign in to comment.