Set up eslint, gotta keep the vibes in check.
This commit is contained in:
parent
72b287e421
commit
9edb030079
12
eslint.config.mjs
Normal file
12
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import eslint from '@eslint/js'
|
||||||
|
import tseslint from 'typescript-eslint'
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
eslint.configs.recommended,
|
||||||
|
tseslint.configs.recommended,
|
||||||
|
{
|
||||||
|
rules: {
|
||||||
|
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
1368
package-lock.json
generated
1368
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -8,7 +8,8 @@
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
"type-check": "tsc --noEmit",
|
"type-check": "tsc --noEmit",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"lint": "prettier --write src/"
|
"lint": "eslint --fix ./src",
|
||||||
|
"style": "prettier --write src/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@linaria/core": "^6.3.0",
|
"@linaria/core": "^6.3.0",
|
||||||
|
|
@ -27,8 +28,10 @@
|
||||||
"@types/react-dom": "^18.3.1",
|
"@types/react-dom": "^18.3.1",
|
||||||
"@vitejs/plugin-react": "^4.3.4",
|
"@vitejs/plugin-react": "^4.3.4",
|
||||||
"@wyw-in-js/vite": "^0.6.0",
|
"@wyw-in-js/vite": "^0.6.0",
|
||||||
|
"eslint": "^9.27.0",
|
||||||
"prettier": "3.5.3",
|
"prettier": "3.5.3",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
|
"typescript-eslint": "^8.32.1",
|
||||||
"vite": "^6.0.1"
|
"vite": "^6.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,39 +147,6 @@ const getMaturityProgressBarStyle = (
|
||||||
boxShadow: '0 0 3px rgba(0, 0, 0, 0.5)',
|
boxShadow: '0 0 3px rgba(0, 0, 0, 0.5)',
|
||||||
})
|
})
|
||||||
|
|
||||||
const modalOverlayStyle: React.CSSProperties = {
|
|
||||||
position: 'fixed',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0,
|
|
||||||
bottom: 0,
|
|
||||||
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
zIndex: 1000,
|
|
||||||
}
|
|
||||||
|
|
||||||
const modalContentStyle: React.CSSProperties = {
|
|
||||||
backgroundColor: 'white',
|
|
||||||
padding: '2rem',
|
|
||||||
borderRadius: '0.5rem',
|
|
||||||
maxWidth: '400px',
|
|
||||||
width: '90%',
|
|
||||||
position: 'relative',
|
|
||||||
}
|
|
||||||
|
|
||||||
const modalCloseButtonStyle: React.CSSProperties = {
|
|
||||||
position: 'absolute',
|
|
||||||
top: '0.5rem',
|
|
||||||
right: '0.5rem',
|
|
||||||
padding: '0.5rem',
|
|
||||||
border: 'none',
|
|
||||||
background: 'none',
|
|
||||||
cursor: 'pointer',
|
|
||||||
fontSize: '1.5rem',
|
|
||||||
}
|
|
||||||
|
|
||||||
const plotInfoStyle: React.CSSProperties = {
|
const plotInfoStyle: React.CSSProperties = {
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexDirection: 'column',
|
flexDirection: 'column',
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import React, {
|
import React, {
|
||||||
useEffect,
|
|
||||||
useState,
|
useState,
|
||||||
useImperativeHandle,
|
useImperativeHandle,
|
||||||
forwardRef,
|
forwardRef,
|
||||||
|
|
|
||||||
|
|
@ -347,7 +347,7 @@ export const useGameStore = create<
|
||||||
})
|
})
|
||||||
|
|
||||||
// Update equipment progress
|
// Update equipment progress
|
||||||
Object.entries(state.equipment).forEach(([id, equipment]) => {
|
Object.entries(state.equipment).forEach(([, equipment]) => {
|
||||||
// TODO: this type cast shouldn't be necessary
|
// TODO: this type cast shouldn't be necessary
|
||||||
const equipmentInstance = equipment as Equipment
|
const equipmentInstance = equipment as Equipment
|
||||||
if (equipmentInstance.isProcessing) {
|
if (equipmentInstance.isProcessing) {
|
||||||
|
|
@ -421,7 +421,7 @@ export const useGameStore = create<
|
||||||
},
|
},
|
||||||
|
|
||||||
buyItem: (itemId) => {
|
buyItem: (itemId) => {
|
||||||
const { cash, landPurchases, plots, fieldSize } = get()
|
const { cash, landPurchases } = get()
|
||||||
const item = ITEMS[itemId]
|
const item = ITEMS[itemId]
|
||||||
|
|
||||||
if (!item || item.buyPrice === null || item.buyPrice === undefined) {
|
if (!item || item.buyPrice === null || item.buyPrice === undefined) {
|
||||||
|
|
@ -499,26 +499,7 @@ export const useGameStore = create<
|
||||||
|
|
||||||
saveToSlot: (slot: number) => {
|
saveToSlot: (slot: number) => {
|
||||||
const state = get()
|
const state = get()
|
||||||
const {
|
const { ...gameState } = state
|
||||||
plant,
|
|
||||||
water,
|
|
||||||
harvest,
|
|
||||||
tick,
|
|
||||||
assignCrop,
|
|
||||||
upgradeField,
|
|
||||||
setGameSpeed,
|
|
||||||
setActionCooldown,
|
|
||||||
buyItem,
|
|
||||||
sellItem,
|
|
||||||
saveToSlot,
|
|
||||||
loadFromSlot,
|
|
||||||
purchaseUpgrade,
|
|
||||||
pray,
|
|
||||||
buyEquipment,
|
|
||||||
configureEquipment,
|
|
||||||
useEquipment,
|
|
||||||
...gameState
|
|
||||||
} = state
|
|
||||||
saveGame(slot, gameState)
|
saveGame(slot, gameState)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue