Skip to content

Commit

Permalink
Merge pull request #18 from Dev-FE-1/feat/fullpath-#17
Browse files Browse the repository at this point in the history
#17 절대경로 설정
  • Loading branch information
seoyoonyi authored Aug 24, 2024
2 parents 69b21f1 + e0347e2 commit e7c9270
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 116 deletions.
8 changes: 6 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ module.exports = {
'no-console': ['warn', { allow: ['warn', 'error'] }],
},
settings: {
react: {
version: 'detect',
react: { version: 'detect' },
'import/resolver': {
alias: {
map: [['@', './src']],
extensions: ['.ts', '.js', '.jsx', '.json'],
},
},
},
}
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,3 @@
# React + TypeScript + Vite
# NP - No Problem

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: __dirname,
},
}
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
# My Idoru
24 changes: 12 additions & 12 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { PATH } from './constants/path'
import { PATH } from '@/constants/path'
import { createBrowserRouter, RouterProvider } from 'react-router-dom'

import CreatePlaylistPage from './pages/CreatePlaylistPage'
import EditProfilePage from './pages/EditProfilePage'
import FollowPage from './pages/FollowPage'
import LoginPage from './pages/LoginPage'
import Page404 from './pages/Page404'
import PlaylistPage from './pages/PlaylistPage'
import ProfilePage from './pages/ProfilePage'
import SearchPage from './pages/SearchPage'
import RootLayout from './layout/Root'
import ChatPage from './pages/ChatPage'
import HomePage from './pages/HomePage'
import CreatePlaylistPage from '@/pages/CreatePlaylistPage'
import EditProfilePage from '@/pages/EditProfilePage'
import FollowPage from '@/pages/FollowPage'
import LoginPage from '@/pages/LoginPage'
import Page404 from '@/pages/Page404'
import PlaylistPage from '@/pages/PlaylistPage'
import ProfilePage from '@/pages/ProfilePage'
import SearchPage from '@/pages/SearchPage'
import RootLayout from '@/layout/Root'
import ChatPage from '@/pages/ChatPage'
import HomePage from '@/pages/HomePage'

const router = createBrowserRouter([
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/styled'
import { NavLink } from 'react-router-dom'
import { PATH } from '../../constants/path'
import { PATH } from '@/constants/path'

const Navbar = () => {
const menu = [
Expand Down
68 changes: 0 additions & 68 deletions src/index.css

This file was deleted.

4 changes: 2 additions & 2 deletions src/layout/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import styled from '@emotion/styled'
import { Outlet } from 'react-router-dom'
import Navbar from '../components/layout/Navbar'
import Header from '../components/layout/Header'
import Navbar from '@/components/layout/Navbar'
import Header from '@/components/layout/Header'

const RootLayout = () => (
<StyledContainer>
Expand Down
3 changes: 1 addition & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import App from '@/App'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
Expand Down
4 changes: 4 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
},

/* Bundler mode */
"moduleResolution": "bundler",
Expand Down
5 changes: 5 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': '/src',
},
},
})

0 comments on commit e7c9270

Please sign in to comment.