diff --git a/webUI/react/.eslintrc.js b/webUI/react/.eslintrc.js index a7772bd..ec920e8 100644 --- a/webUI/react/.eslintrc.js +++ b/webUI/react/.eslintrc.js @@ -1,22 +1,33 @@ module.exports = { - env: { - browser: true, - es2021: true, - }, - extends: [ - 'plugin:react/recommended', - 'airbnb', - ], - parserOptions: { - ecmaFeatures: { - jsx: true, + env: { + browser: true, + es2021: true, + }, + extends: [ + 'plugin:react/recommended', + 'airbnb', + ], + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + ecmaVersion: 12, + sourceType: 'module', + }, + plugins: [ + 'react', + ], + rules: { + // Indent with 4 spaces + indent: ['error', 4], + + // Indent JSX with 4 spaces + 'react/jsx-indent': ['error', 4], + + // Indent props with 4 spaces + 'react/jsx-indent-props': ['error', 4], + + // allow JSX in both js and jsx files + 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], }, - ecmaVersion: 12, - sourceType: 'module', - }, - plugins: [ - 'react', - ], - rules: { - }, }; diff --git a/webUI/react/src/App.js b/webUI/react/src/App.js index 0e8e105..a43e023 100644 --- a/webUI/react/src/App.js +++ b/webUI/react/src/App.js @@ -1,31 +1,28 @@ -import React, {useState} from "react"; +import React, { useState } from 'react'; import { BrowserRouter as Router, Switch, Route, - Link -} from "react-router-dom"; +} from 'react-router-dom'; import Button from '@material-ui/core/Button'; -import TemporaryDrawer from "./components/TemporaryDrawer"; -import NavBar from "./components/NavBar"; -import ExtensionCard from "./components/ExtensionCard"; - +import NavBar from './components/NavBar'; +import ExtensionCard from './components/ExtensionCard'; export default function App() { return ( - {/**/} - + {/* */} + - + - + - + @@ -34,15 +31,15 @@ export default function App() { function Extensions() { let mapped; - let [extensions, setExtensions] = useState([]) + const [extensions, setExtensions] = useState([]); if (extensions.length === 0) { mapped =

wait

; - fetch("http://127.0.0.1:4567/api/v1/extensions") - .then(response => response.json()) - .then(data => setExtensions(data)); + fetch('http://127.0.0.1:4567/api/v1/extensions') + .then((response) => response.json()) + .then((data) => setExtensions(data)); } else { - mapped = extensions.map(it => ); + mapped = extensions.map((it) => ); } return

{mapped}

; @@ -53,7 +50,7 @@ function Home() { - ) + ); } function Users() {