From 017c1c75d0aaa0ecefa77d1a9f18eb233a742037 Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Sun, 26 Jun 2022 13:46:30 +0100 Subject: [PATCH] fix eslint. --- .eslintrc.json | 6 +++--- CommonUI/src/Utils/React.ts | 10 ++++++++++ CommonUI/src/Utils/Router.ts | 18 ++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 CommonUI/src/Utils/React.ts create mode 100644 CommonUI/src/Utils/Router.ts diff --git a/.eslintrc.json b/.eslintrc.json index 745a19a308..a6c185ae83 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -66,7 +66,7 @@ "yield-star-spacing": "error", "no-implicit-coercion": "error", "no-extra-label": "error", - "multiline-comment-style": "error", + "multiline-comment-style": "off", "no-lonely-if": "error", "no-floating-decimal": "error", "eqeqeq": "error", @@ -162,9 +162,9 @@ "react/jsx-pascal-case": "error", "array-callback-return": "error", "no-loop-func": "error", - "no-duplicate-imports": "error", /// Enable this and fix errors. + "no-duplicate-imports": "error", "no-promise-executor-return": "error", - "capitalized-comments": "off", // turn this on after ts-migration. + "capitalized-comments": "off", // this is turned off because come commented code should not be capitalized. "for-direction": "error", "getter-return": "error", "jsx-a11y/anchor-is-valid": "error", diff --git a/CommonUI/src/Utils/React.ts b/CommonUI/src/Utils/React.ts new file mode 100644 index 0000000000..92935168f1 --- /dev/null +++ b/CommonUI/src/Utils/React.ts @@ -0,0 +1,10 @@ +import React, { useState, useEffect, FunctionComponent as FC, ReactElement as RE } from 'react'; + +export default { + React, + useState, + useEffect +} + +export type FunctionComponent = FC; +export type ReactElement = RE; \ No newline at end of file diff --git a/CommonUI/src/Utils/Router.ts b/CommonUI/src/Utils/Router.ts new file mode 100644 index 0000000000..af533a53c2 --- /dev/null +++ b/CommonUI/src/Utils/Router.ts @@ -0,0 +1,18 @@ +import { + Routes, + Route as PageRoute, + useNavigate, + BrowserRouter, + useLocation, +} from 'react-router-dom'; + +import ReactDOM from 'react-dom/client'; + +export default { + Routes, + PageRoute, + useNavigate, + useLocation, + BrowserRouter, + ReactDOM +} \ No newline at end of file