mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2024-12-25 00:01:49 +01:00
a bit of eslint rules
This commit is contained in:
parent
c3a4f827cb
commit
59c69a4f7f
@ -18,5 +18,16 @@ module.exports = {
|
|||||||
'react',
|
'react',
|
||||||
],
|
],
|
||||||
rules: {
|
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'] }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
import React, {useState} from "react";
|
import React, { useState } from 'react';
|
||||||
import {
|
import {
|
||||||
BrowserRouter as Router,
|
BrowserRouter as Router,
|
||||||
Switch,
|
Switch,
|
||||||
Route,
|
Route,
|
||||||
Link
|
} from 'react-router-dom';
|
||||||
} from "react-router-dom";
|
|
||||||
import Button from '@material-ui/core/Button';
|
import Button from '@material-ui/core/Button';
|
||||||
import TemporaryDrawer from "./components/TemporaryDrawer";
|
import NavBar from './components/NavBar';
|
||||||
import NavBar from "./components/NavBar";
|
import ExtensionCard from './components/ExtensionCard';
|
||||||
import ExtensionCard from "./components/ExtensionCard";
|
|
||||||
|
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
@ -34,15 +31,15 @@ export default function App() {
|
|||||||
|
|
||||||
function Extensions() {
|
function Extensions() {
|
||||||
let mapped;
|
let mapped;
|
||||||
let [extensions, setExtensions] = useState([])
|
const [extensions, setExtensions] = useState([]);
|
||||||
|
|
||||||
if (extensions.length === 0) {
|
if (extensions.length === 0) {
|
||||||
mapped = <h3>wait</h3>;
|
mapped = <h3>wait</h3>;
|
||||||
fetch("http://127.0.0.1:4567/api/v1/extensions")
|
fetch('http://127.0.0.1:4567/api/v1/extensions')
|
||||||
.then(response => response.json())
|
.then((response) => response.json())
|
||||||
.then(data => setExtensions(data));
|
.then((data) => setExtensions(data));
|
||||||
} else {
|
} else {
|
||||||
mapped = extensions.map(it => <ExtensionCard {...it} />);
|
mapped = extensions.map((it) => <ExtensionCard {...it} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
return <h2>{mapped}</h2>;
|
return <h2>{mapped}</h2>;
|
||||||
@ -53,7 +50,7 @@ function Home() {
|
|||||||
<Button variant="contained" color="primary">
|
<Button variant="contained" color="primary">
|
||||||
Hello World
|
Hello World
|
||||||
</Button>
|
</Button>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function Users() {
|
function Users() {
|
||||||
|
Loading…
Reference in New Issue
Block a user