Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

ESLint improvements

AykutSarac1ddeb72dca16
diff --git a/.eslintrc.json b/.eslintrc.json
index 4ae05260..271ea01f 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -1,9 +1,10 @@
{
"rules": {
- "@next/next/no-img-element": "off"
+ "@next/next/no-img-element": "off",
+ "unused-imports/no-unused-imports": "error"
},
"extends": ["next/core-web-vitals"],
- "plugins": ["testing-library"],
+ "plugins": ["testing-library", "unused-imports"],
"overrides": [
// Only uses Testing Library lint rules in test files
{
diff --git a/package.json b/package.json
index 62e015e7..c5f571bb 100644
--- a/package.json
+++ b/package.json
@@ -53,6 +53,7 @@
"eslint": "8.23.0",
"eslint-config-next": "12.2.5",
"eslint-plugin-testing-library": "^5.6.1",
+ "eslint-plugin-unused-imports": "^2.0.0",
"gh-pages": "^4.0.0",
"jest": "^29.0.2",
"jest-environment-jsdom": "^29.0.2",
diff --git a/src/components/CustomNode/ObjectNode.tsx b/src/components/CustomNode/ObjectNode.tsx
index fc1c9f91..e0f1f3e4 100644
--- a/src/components/CustomNode/ObjectNode.tsx
+++ b/src/components/CustomNode/ObjectNode.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import { useInViewport } from "react-in-viewport";
+// import { useInViewport } from "react-in-viewport";
import { CustomNodeProps } from "src/components/CustomNode";
import useConfig from "src/hooks/store/useConfig";
import * as Styled from "./styles";
diff --git a/src/components/CustomNode/TextNode.tsx b/src/components/CustomNode/TextNode.tsx
index 5e52895f..fb7e8a87 100644
--- a/src/components/CustomNode/TextNode.tsx
+++ b/src/components/CustomNode/TextNode.tsx
@@ -1,6 +1,6 @@
import React from "react";
import { MdLink, MdLinkOff } from "react-icons/md";
-import { useInViewport } from "react-in-viewport";
+// import { useInViewport } from "react-in-viewport";
import { CustomNodeProps } from "src/components/CustomNode";
import useConfig from "src/hooks/store/useConfig";
import useGraph from "src/hooks/store/useGraph";
diff --git a/src/components/CustomNode/index.tsx b/src/components/CustomNode/index.tsx
index 7638ea70..b9540ddf 100644
--- a/src/components/CustomNode/index.tsx
+++ b/src/components/CustomNode/index.tsx
@@ -1,6 +1,5 @@
import React from "react";
import { Node, NodeProps } from "reaflow";
-import useGraph from "src/hooks/store/useGraph";
import ObjectNode from "./ObjectNode";
import TextNode from "./TextNode";
diff --git a/src/containers/Home/index.tsx b/src/containers/Home/index.tsx
index 1e976857..4dc250a6 100644
--- a/src/containers/Home/index.tsx
+++ b/src/containers/Home/index.tsx
@@ -1,7 +1,6 @@
import React from "react";
import Head from "next/head";
import Link from "next/link";
-import { useRouter } from "next/router";
import { FaGithub, FaHeart, FaLinkedin, FaTwitter } from "react-icons/fa";
import {
HiCursorClick,
diff --git a/yarn.lock b/yarn.lock
index 73a55556..3b625b70 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4011,6 +4011,18 @@ eslint-plugin-testing-library@^5.6.1:
dependencies:
"@typescript-eslint/utils" "^5.13.0"
+eslint-plugin-unused-imports@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-2.0.0.tgz#d8db8c4d0cfa0637a8b51ce3fd7d1b6bc3f08520"
+ integrity sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==
+ dependencies:
+ eslint-rule-composer "^0.3.0"
+
+eslint-rule-composer@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9"
+ integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg==
+
eslint-scope@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"