Skip to content

Commit

Permalink
Use linter to fix all files
Browse files Browse the repository at this point in the history
  • Loading branch information
midudev committed Feb 19, 2023
1 parent a75a5d5 commit fdc62b5
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
2 changes: 0 additions & 2 deletions projects/01-twitter-follow-card/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useState } from 'react'

import './App.css'
import { TwitterFollowCard } from './TwitterFollowCard.jsx'

Expand Down
2 changes: 1 addition & 1 deletion projects/01-twitter-follow-card/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react()]
})
12 changes: 6 additions & 6 deletions projects/02-tic-tac-toe/src/components/WinnerModal.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Square } from "./Square.jsx"
import { Square } from './Square.jsx'

export function WinnerModal ({ winner, resetGame}) {
export function WinnerModal ({ winner, resetGame }) {
if (winner === null) return null

const winnerText = winner === false ? 'Empate' : 'Ganó:'

return (
<section className="winner">
<div className="text">
<section className='winner'>
<div className='text'>
<h2>{winnerText}</h2>

<header className="win">
<header className='win'>
{winner && <Square>{winner}</Square>}
</header>

Expand All @@ -20,4 +20,4 @@ export function WinnerModal ({ winner, resetGame}) {
</div>
</section>
)
}
}
6 changes: 3 additions & 3 deletions projects/02-tic-tac-toe/src/constants.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const TURNS = { // turnos
X: '❌',
O: '⚪'
X: '❌',
O: '⚪'
}

export const WINNER_COMBOS = [
Expand All @@ -12,4 +12,4 @@ export const WINNER_COMBOS = [
[2, 5, 8],
[0, 4, 8],
[2, 4, 6]
]
]
4 changes: 2 additions & 2 deletions projects/02-tic-tac-toe/src/logic/board.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WINNER_COMBOS } from "../constants.js"
import { WINNER_COMBOS } from '../constants.js'

export const checkWinnerFrom = (boardToCheck) => {
// revisamos todas las combinaciones ganadoras
Expand All @@ -22,4 +22,4 @@ export const checkEndGame = (newBoard) => {
// si no hay más espacios vacíos
// en el tablero
return newBoard.every((square) => square !== null)
}
}
4 changes: 2 additions & 2 deletions projects/02-tic-tac-toe/src/logic/storage/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const saveGameToStorage = ({ board, turn}) => {
export const saveGameToStorage = ({ board, turn }) => {
// guardar aqui partida
window.localStorage.setItem('board', JSON.stringify(board))
window.localStorage.setItem('turn', turn)
Expand All @@ -7,4 +7,4 @@ export const saveGameToStorage = ({ board, turn}) => {
export const resetGameStorage = () => {
window.localStorage.removeItem('board')
window.localStorage.removeItem('turn')
}
}
2 changes: 1 addition & 1 deletion projects/02-tic-tac-toe/src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import './index.css'
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
<App />
</React.StrictMode>,
</React.StrictMode>
)
2 changes: 1 addition & 1 deletion projects/02-tic-tac-toe/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react()]
})
2 changes: 1 addition & 1 deletion projects/03-mouse-follower/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react()]
})
2 changes: 1 addition & 1 deletion projects/04-react-prueba-tecnica/counter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function setupCounter(element) {
export function setupCounter (element) {
let counter = 0
const setCounter = (count) => {
counter = count
Expand Down
4 changes: 3 additions & 1 deletion projects/05-react-buscador-peliculas/src/hooks/useMovies.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { searchMovies } from '../services/movies.js'
export function useMovies ({ search, sort }) {
const [movies, setMovies] = useState([])
const [loading, setLoading] = useState(false)
const [error, setError] = useState(null)
// el error no se usa pero puedes implementarlo
// si quieres:
const [, setError] = useState(null)
const previousSearch = useRef(search)

const getMovies = useCallback(async ({ search }) => {
Expand Down
2 changes: 1 addition & 1 deletion projects/05-react-buscador-peliculas/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react()]
})
2 changes: 1 addition & 1 deletion projects/06-shopping-cart/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react-swc'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react()]
})

0 comments on commit fdc62b5

Please sign in to comment.