Skip to content

Commit

Permalink
Add stylelint, tailwindcss, nextui, floating-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwreey committed Nov 22, 2023
1 parent 046c920 commit a847d66
Show file tree
Hide file tree
Showing 12 changed files with 6,143 additions and 1,496 deletions.
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "ms-azuretools.vscode-docker"]
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "ms-azuretools.vscode-docker", "stylelint.vscode-stylelint"]
}
5 changes: 5 additions & 0 deletions frontend/.linariarc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variableNameConfig": "var",
"evaluate": true,
"displayName": true
}
2 changes: 1 addition & 1 deletion frontend/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "*.{js,ts,jsx,tsx}": "eslint --fix" }
{ "*.{js,ts,jsx,tsx}": "eslint --fix", "*.{tsx,css}": "stylelint --fix" }
4 changes: 4 additions & 0 deletions frontend/.stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["stylelint-config-recommended", "stylelint-config-tailwindcss", "@linaria/stylelint"],
"customSyntax": "@linaria/postcss-linaria"
}
21 changes: 17 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,40 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"lint:css": "stylelint src/**/*.{tsc,css}",
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:eslint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "pnpm lint:css ; pnpm lint:eslint",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.18",
"@floating-ui/react": "^0.26.2",
"@linaria/core": "^5.0.2",
"@linaria/react": "^5.0.3",
"@nextui-org/react": "^2.2.9",
"framer-motion": "^10.16.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@linaria/postcss-linaria": "^5.0.0",
"@linaria/stylelint": "^5.0.4",
"@linaria/vite": "^5.0.4",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.53.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"postcss": "^8.4.31",
"stylelint": "^15.11.0",
"stylelint-config-recommended": "^13.0.0",
"stylelint-config-tailwindcss": "^0.0.7",
"tailwindcss": "^3.3.5",
"typescript": "^5.2.2",
"vite": "^5.0.0"
}
Expand Down
6 changes: 6 additions & 0 deletions frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
26 changes: 1 addition & 25 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
import { useState } from "react"
import reactLogo from "./assets/react.svg"
import viteLogo from "/vite.svg"
import "./App.css"

function App() {
const [count, setCount] = useState(0)

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">Click on the Vite and React logos to learn more</p>
</>
)
return <></>
}

export default App
5 changes: 4 additions & 1 deletion frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ import React from "react"
import ReactDOM from "react-dom/client"
import App from "./App.tsx"
import "./index.css"
import { NextUIProvider } from "@nextui-org/react"

ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
<NextUIProvider>
<App />
</NextUIProvider>
</React.StrictMode>,
)
12 changes: 12 additions & 0 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// tailwind.config.js
import nextui from "@nextui-org/react"

/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{js,ts,jsx,tsx}", "./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
darkMode: "class",
plugins: [nextui()],
}
3 changes: 2 additions & 1 deletion frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { defineConfig } from "vite"
import react from "@vitejs/plugin-react-swc"
import linaria from "@linaria/vite"

// https://vitejs.dev/config/
export default defineConfig({
clearScreen: false,
plugins: [react()],
plugins: [react(), linaria()],
server: {
proxy: {
"/api": "http://localhost:8080",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"license": "MIT",
"private": false,
"scripts": {
"build": "pnpm run -r --parallel build",
"dev": "pnpm run -r --parallel dev",
"lint": "pnpm run -r --parallel lint",
"format": "prettier --ignore-path .gitignore -w .",
Expand Down
Loading

0 comments on commit a847d66

Please sign in to comment.