lint
This commit is contained in:
1 parent
b91f877045
commit
f76ceb011e
11 files changed
+56
-52
No files matched your search
+11
-7
@@ -8,23 +8,27 @@ module.exports = {
|
||||
"build/"
|
||||
],
|
||||
rules: {
|
||||
'arrow-body-style': [0],
|
||||
|
||||
'max-len': ['error', 120],
|
||||
|
||||
'no-console': [0],
|
||||
'no-multi-spaces': [0],
|
||||
// prevents stupid complaints a la
|
||||
// (req) {
|
||||
// req.something = x;
|
||||
// }
|
||||
'no-param-reassign': [2, { props: false }],
|
||||
'no-multi-spaces': [0],
|
||||
'max-len': ['error', 120],
|
||||
'import/no-extraneous-dependencies': [0],
|
||||
'prefer-arrow-callback': [0],
|
||||
'arrow-body-style': [0],
|
||||
'no-return-assign': 0,
|
||||
'no-console': [0],
|
||||
|
||||
'prefer-arrow-callback': [0],
|
||||
|
||||
// i like loops
|
||||
'no-plusplus': [0],
|
||||
|
||||
'no-await-in-loop': [0],
|
||||
|
||||
indent: ['error', 4],
|
||||
|
||||
'keyword-spacing': ['error'],
|
||||
'key-spacing': ['error'],
|
||||
},
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"build": "preact build --no-prerender",
|
||||
"start": "preact --no-clear watch",
|
||||
"lint": "eslint src"
|
||||
"lint": "eslint --fix src"
|
||||
},
|
||||
"dependencies": {
|
||||
"@reduxjs/toolkit": "^1.8.5",
|
||||
|
||||
@@ -72,7 +72,7 @@ const Nav = () => {
|
||||
return (
|
||||
<header>
|
||||
{user ? nav() : anonNav()}
|
||||
{showAdmin(user) ? adminNav() : <div></div>}
|
||||
{showAdmin(user) ? adminNav() : <div />}
|
||||
{user ? userNav() : null}
|
||||
</header>
|
||||
);
|
||||
|
||||
@@ -65,7 +65,7 @@ export default function OfferGroup(group, i) {
|
||||
return (
|
||||
<div class="offer" key={i}>
|
||||
<section>
|
||||
<h3>{group.details.artists_sort} - {group.details.title} <a href={group.details.uri} target="_blank"><ExternalLink /></a></h3>
|
||||
<h3>{group.details.artists_sort} - {group.details.title} <a href={group.details.uri} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
|
||||
<div class='alt-text details'>
|
||||
{group.details.year} - {detailText}
|
||||
</div>
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function Offer(offer) {
|
||||
return (
|
||||
<div class="offer">
|
||||
<section>
|
||||
<h3>{details.artists_sort} - {details.title} <a href={details.uri} target="_blank"><ExternalLink /></a></h3>
|
||||
<h3>{details.artists_sort} - {details.title} <a href={details.uri} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
|
||||
<div class='alt-text' >{details.year}</div>
|
||||
<div class='alt-text'>{details.formats[0].descriptions.join(' ')}</div>
|
||||
<div class='number'>mcrates price: ${offer.total}</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ function Want(want) {
|
||||
return (
|
||||
<article key={r.id}>
|
||||
<div>
|
||||
<h3>{r.artists_sort} - {r.title} <a href={r.uri} target="_blank"><ExternalLink /></a></h3>
|
||||
<h3>{r.artists_sort} - {r.title} <a href={r.uri} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
|
||||
</div>
|
||||
<img src={r.thumb} />
|
||||
<div class='details'>
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ declare module 'axios' {
|
||||
}
|
||||
|
||||
const api = axios.create({
|
||||
baseURL: '/api',
|
||||
withCredentials: true
|
||||
baseURL: '/api',
|
||||
withCredentials: true
|
||||
});
|
||||
|
||||
function onSuccess(response) {
|
||||
|
||||
@@ -34,7 +34,7 @@ function Item({ item }) {
|
||||
|
||||
return (
|
||||
<div key={item.id} class={bold}>
|
||||
<a href={item.listing.data.uri} target="_blank" >
|
||||
<a href={item.listing.data.uri} target="_blank" rel="noreferrer" >
|
||||
<h4>{item.listing.data.release.description}</h4>
|
||||
</a>
|
||||
<h5>{item.user.email}</h5>
|
||||
@@ -53,7 +53,7 @@ function SellerGroup(group) {
|
||||
|
||||
return (
|
||||
<div class="bundle">
|
||||
<section>
|
||||
<section>
|
||||
<h2>{group.username} - {group.seller}</h2>
|
||||
<h3>{ready} / {group.offers.length} offers</h3>
|
||||
<h4>Ships: {group.mentionsAustralia && 'AU'} {group.mentionsWorldwide && 'WORLD'}</h4>
|
||||
|
||||
@@ -93,7 +93,7 @@ const Login = ({ mode }) => {
|
||||
<input type="password" name="password" id="password" />
|
||||
</div>
|
||||
<div class="item">
|
||||
<input type="submit" value="login"/>
|
||||
<input type="submit" value="login" />
|
||||
</div>
|
||||
</form>
|
||||
<button onClick={gotoRegister}> create account </button>
|
||||
|
||||
@@ -27,7 +27,7 @@ function Result(r, wants) {
|
||||
<article key={r.id}>
|
||||
<button onClick={onClick} disabled={added} class={classes} >{btnText}</button>
|
||||
<div>
|
||||
<h3>{r.title} <a href={`https://discogs.com${r.uri}`} target="_blank"><ExternalLink /></a></h3>
|
||||
<h3>{r.title} <a href={`https://discogs.com${r.uri}`} target="_blank" rel="noreferrer"><ExternalLink /></a></h3>
|
||||
<h5 class='alt-text' >{r.year}</h5>
|
||||
<h5 class='alt-text'>{r.country}</h5>
|
||||
<h5 class='alt-text'>{r.format.join(' ')}</h5>
|
||||
@@ -89,7 +89,7 @@ const User = () => {
|
||||
: null;
|
||||
|
||||
const infoEl = infoText
|
||||
? <article><div></div><div>{infoText}</div></article>
|
||||
? <article><div /><div>{infoText}</div></article>
|
||||
: null;
|
||||
|
||||
return (
|
||||
|
||||
+33
-33
@@ -2,58 +2,58 @@ import { createStore, combineReducers } from 'redux'
|
||||
import { configureStore, createSlice } from '@reduxjs/toolkit'
|
||||
|
||||
export const userState = createSlice({
|
||||
name: 'user',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
name: 'user',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
});
|
||||
|
||||
export const offersState = createSlice({
|
||||
name: 'offers',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
name: 'offers',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
});
|
||||
|
||||
export const acpOffersState = createSlice({
|
||||
name: 'acpOffers',
|
||||
initialState: [],
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
name: 'acpOffers',
|
||||
initialState: [],
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
});
|
||||
|
||||
export const wantsState = createSlice({
|
||||
name: 'wants',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
name: 'wants',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
});
|
||||
|
||||
export const wsState = createSlice({
|
||||
name: 'ws',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
name: 'ws',
|
||||
initialState: null,
|
||||
reducers: {
|
||||
set: (state, action) => action.payload
|
||||
},
|
||||
});
|
||||
|
||||
const reducer = combineReducers({
|
||||
offers: offersState.reducer,
|
||||
wants: wantsState.reducer,
|
||||
ws: wsState.reducer,
|
||||
user: userState.reducer,
|
||||
offers: offersState.reducer,
|
||||
wants: wantsState.reducer,
|
||||
ws: wsState.reducer,
|
||||
user: userState.reducer,
|
||||
|
||||
acpOffers: acpOffersState.reducer,
|
||||
acpOffers: acpOffersState.reducer,
|
||||
});
|
||||
|
||||
const store = createStore(
|
||||
reducer,
|
||||
// @ts-ignore -- devtools window exists on dev
|
||||
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
||||
reducer,
|
||||
// @ts-ignore -- devtools window exists on dev
|
||||
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
|
||||
);
|
||||
|
||||
export default store;
|
||||
|
||||
Reference in new issue
Block a user