Skip to content

Commit

Permalink
refactor: linted multiple files
Browse files Browse the repository at this point in the history
  • Loading branch information
juunie-roh committed May 27, 2024
1 parent fe590a0 commit 73b4b82
Show file tree
Hide file tree
Showing 29 changed files with 157 additions and 427 deletions.
1 change: 1 addition & 0 deletions .eslintrc → .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"plugin:prettier/recommended"
],
"rules": {
"import/extensions": "off",
"prettier/prettier": [
"error",
{
Expand Down
207 changes: 37 additions & 170 deletions .pnp.cjs

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Git LFS file not shown

This file was deleted.

3 changes: 0 additions & 3 deletions .yarn/cache/eslint-utils-npm-2.1.0-a3a7ebf4fa-69521c5d65.zip

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"cssnano": "^6.0.3",
"eslint": "^8.56.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "6.0.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-next": "^14.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
Expand Down
2 changes: 1 addition & 1 deletion src/.next/cache/eslint/.cache_8hexeq

Large diffs are not rendered by default.

36 changes: 17 additions & 19 deletions src/app/portfolio/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,22 @@ export const metadata: Metadata = {

export default function PortfolioPage() {
return (
<>
<DefaultLayout>
<h2 className="text-gray-900 dark:text-gray-100">Portfolios</h2>
<ul>
{menus.map((menu) => {
return (
<li
key={menu.key}
className="text-xl text-gray-900 dark:text-gray-100"
>
<Link href={menu.href} scroll={false}>
{menu.title}
</Link>
</li>
);
})}
</ul>
</DefaultLayout>
</>
<DefaultLayout>
<h2 className="text-gray-900 dark:text-gray-100">Portfolios</h2>
<ul>
{menus.map((menu) => {
return (
<li
key={menu.key}
className="text-xl text-gray-900 dark:text-gray-100"
>
<Link href={menu.href} scroll={false}>
{menu.title}
</Link>
</li>
);
})}
</ul>
</DefaultLayout>
);
}
15 changes: 6 additions & 9 deletions src/app/techrecord/(pages)/cannon-raycast-vehicle/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,22 @@ const Pillar = (props: CylinderProps) => {
};

export default function CannonRaycastVehicle() {
const { ambient_intensity, spot_intensity } = useControls(
'Light Intensities',
{
ambient_intensity: { value: 0.1, min: 0, max: 2, step: 0.1 },
spot_intensity: { value: 1, min: 0, max: 3, step: 0.1 },
},
);
const { ambientIntensity, spotIntensity } = useControls('Light Intensities', {
ambientIntensity: { value: 0.1, min: 0, max: 2, step: 0.1 },
spotIntensity: { value: 1, min: 0, max: 3, step: 0.1 },
});

return (
<>
<ThreeCanvas>
<Canvas shadows camera={{ fov: 50, position: [0, 5, 15] }}>
<fog attach="fog" args={['#171720', 10, 50]} />
<color attach="background" args={['#171720']} />
<ambientLight intensity={ambient_intensity} />
<ambientLight intensity={ambientIntensity} />
<spotLight
position={[10, 10, 10]}
angle={Math.PI / 3}
intensity={spot_intensity}
intensity={spotIntensity}
castShadow
penumbra={1}
/>
Expand Down
36 changes: 15 additions & 21 deletions src/app/techrecord/(pages)/three-example/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,20 @@ import { ThreeCanvas } from '@/layouts';

export default function ThreeExample() {
return (
<>
<ThreeCanvas>
<Canvas>
<ambientLight intensity={Math.PI / 2} />
<spotLight
position={[10, 10, 10]}
angle={0.15}
penumbra={1}
decay={0}
intensity={Math.PI}
/>
<pointLight
position={[-10, -10, -10]}
decay={0}
intensity={Math.PI}
/>
<ThreeSimpleBox position={[-1.2, 0, 0]} />
<ThreeSimpleBox position={[1.2, 0, 0]} />
</Canvas>
</ThreeCanvas>
</>
<ThreeCanvas>
<Canvas>
<ambientLight intensity={Math.PI / 2} />
<spotLight
position={[10, 10, 10]}
angle={0.15}
penumbra={1}
decay={0}
intensity={Math.PI}
/>
<pointLight position={[-10, -10, -10]} decay={0} intensity={Math.PI} />
<ThreeSimpleBox position={[-1.2, 0, 0]} />
<ThreeSimpleBox position={[1.2, 0, 0]} />
</Canvas>
</ThreeCanvas>
);
}
28 changes: 12 additions & 16 deletions src/app/techrecord/(pages)/water-example/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,17 @@ const Box = () => {

export default function WaterExample() {
return (
<>
<ThreeCanvas>
<Canvas
camera={{ position: [0, 5, 100], fov: 55, near: 1, far: 20000 }}
>
<pointLight position={[100, 100, 100]} />
<pointLight position={[-100, -100, -100]} />
<Suspense fallback={null}>
<Ocean />
<Sky sunPosition={[500, 150, -1000]} turbidity={0.1} />
</Suspense>
<Box />
<OrbitControls />
</Canvas>
</ThreeCanvas>
</>
<ThreeCanvas>
<Canvas camera={{ position: [0, 5, 100], fov: 55, near: 1, far: 20000 }}>
<pointLight position={[100, 100, 100]} />
<pointLight position={[-100, -100, -100]} />
<Suspense fallback={null}>
<Ocean />
<Sky sunPosition={[500, 150, -1000]} turbidity={0.1} />
</Suspense>
<Box />
<OrbitControls />
</Canvas>
</ThreeCanvas>
);
}
50 changes: 24 additions & 26 deletions src/app/techrecord/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,29 @@ export const metadata: Metadata = {

export default function TechrecordPage() {
return (
<>
<DefaultLayout>
<h2 className="text-gray-900 dark:text-gray-100">Tech Record</h2>
<table>
<tbody>
{menus.map((menu) => {
return (
<tr
key={menu.key}
className="align-baseline text-gray-900 dark:text-gray-100"
>
<td className="w-1/5 text-nowrap text-right">
<span className="mr-2 text-sm">{menu.ctgry}</span>
</td>
<td className="w-4/5 text-left">
<Link prefetch className="text-xl" href={menu.href}>
{menu.title}
</Link>
</td>
</tr>
);
})}
</tbody>
</table>
</DefaultLayout>
</>
<DefaultLayout>
<h2 className="text-gray-900 dark:text-gray-100">Tech Record</h2>
<table>
<tbody>
{menus.map((menu) => {
return (
<tr
key={menu.key}
className="align-baseline text-gray-900 dark:text-gray-100"
>
<td className="w-1/5 text-nowrap text-right">
<span className="mr-2 text-sm">{menu.ctgry}</span>
</td>
<td className="w-4/5 text-left">
<Link prefetch className="text-xl" href={menu.href}>
{menu.title}
</Link>
</td>
</tr>
);
})}
</tbody>
</table>
</DefaultLayout>
);
}
2 changes: 1 addition & 1 deletion src/components/cannon/Beetle/Vehicle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useFrame } from '@react-three/fiber';
import { type Ref, useRef } from 'react';
import type { Group, Object3D } from 'three';

import { useControls } from '@/utils/use-controls';
import { useControls } from '@/utils/useControls';

import { Chassis } from './Chassis';
import { Wheel } from './Wheel';
Expand Down
2 changes: 1 addition & 1 deletion src/libs/AsyncReducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class AsyncReducers {
* })
* ```
*/
static create = <State extends AsyncState>(
static create = <D = any, State = AsyncState<D[]>>(
builder: ActionReducerMapBuilder<State>,
) => {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/libs/features/catFacts/catFactsSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const catFactsSlice = createSlice({
extraReducers: (builder) => AsyncReducers.create(builder)(getCatFacts),
});

export default catFactsSlice.reducer;
export const catFactsReducer = catFactsSlice.reducer;
13 changes: 8 additions & 5 deletions src/libs/features/counter/counterSlice.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { createSlice } from '@reduxjs/toolkit';

const initialState = {
value: 0,
import type { AsyncState } from '@/libs/types';

const initialState: AsyncState<any> = {
data: 0,
status: 'fulfilled',
};

const counterSlice = createSlice({
Expand All @@ -10,14 +13,14 @@ const counterSlice = createSlice({
reducers: {
increment: (state) => {
// eslint-disable-next-line no-param-reassign
state.value += 1;
state.data += 1;
},
decrement: (state) => {
// eslint-disable-next-line no-param-reassign
state.value -= 1;
state.data -= 1;
},
},
});

export const { increment, decrement } = counterSlice.actions;
export default counterSlice.reducer;
export const counterReducer = counterSlice.reducer;
2 changes: 2 additions & 0 deletions src/libs/features/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './catFacts/catFactsSlice';
export * from './counter/counterSlice';
3 changes: 1 addition & 2 deletions src/libs/store.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { configureStore } from '@reduxjs/toolkit';

import catFactsReducer from '@/libs/features/catFacts/catFactsSlice';
import counterReducer from '@/libs/features/counter/counterSlice';
import { catFactsReducer, counterReducer } from '@/libs/features';

export const makeStore = () => {
return configureStore({
Expand Down
4 changes: 2 additions & 2 deletions src/libs/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type AsyncState = {
data: any;
export type AsyncState<D> = {
data: D;
status: 'fulfilled' | 'pending' | 'rejected';
};
20 changes: 10 additions & 10 deletions src/types/user.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export type TOGGLE_LOGIN = 'TOGGLE_LOGIN';
export type SET_NAME = 'SET_NAME';
export type SET_ID = 'SET_ID';
export type SET_INFO = 'SET_INFO';
export type SET_AUTH = 'SET_AUTH';
export type ToggleLogin = 'TOGGLE_LOGIN';
export type SetName = 'SET_NAME';
export type SetId = 'SET_ID';
export type SetInfo = 'SET_INFO';
export type SetAuth = 'SET_AUTH';

export type UserState = {
isLoggedIn: boolean;
Expand All @@ -13,8 +13,8 @@ export type UserState = {
};

export type UserAction =
| { type: TOGGLE_LOGIN; isLoggedIn: boolean }
| { type: SET_NAME; userName: string }
| { type: SET_ID; userId: string }
| { type: SET_INFO; userInfo: string }
| { type: SET_AUTH; authorization: string };
| { type: ToggleLogin; isLoggedIn: boolean }
| { type: SetName; userName: string }
| { type: SetId; userId: string }
| { type: SetInfo; userInfo: string }
| { type: SetAuth; authorization: string };
File renamed without changes.
Loading

0 comments on commit 73b4b82

Please sign in to comment.