Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore bump daisy UI to latest, eslint changes #25

Merged
merged 3 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

18 changes: 17 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
browser: true,
es2021: true,
},
plugins: ['@typescript-eslint', 'react', 'react-refresh'],
plugins: ['simple-import-sort', 'react', 'react-refresh', 'node-import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/strict-type-checked',
Expand Down Expand Up @@ -68,5 +68,21 @@ module.exports = {
'warn',
{ allowConstantExport: true },
],

// stylistic
'object-shorthand': ['error', 'always'],
'func-style': ['error', 'expression'],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'node-import/prefer-node-protocol': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
},
ignorePatterns: [
'node_modules/',
'dist/',
'coverage/',
'vite.config.ts.*.mjs',
],
}
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ degit jimmy-guzman/react-starter

## Getting Started

Make sure you're using [node 20](https://nodejs.dev/en/about/releases), I recommend using [fnm](https://github.com/Schniz/fnm) which will allow to simply run:
Make sure you're using [node 20](https://nodejs.dev/en/about/releases), I recommend using [fnm](https://github.com/Schniz/fnm) which will allow you to simply run:

```
fnm use
Expand All @@ -48,6 +48,12 @@ First install dependencies with [pnpm](https://pnpm.io/installation), by running
pnpm install
```

And to download new browsers for Playwright, run the following command:

```
pnpm exec playwright install
```

Then to run the development server, run the following command:

```
Expand Down
2 changes: 1 addition & 1 deletion e2e/app.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect } from '@playwright/test'
import { expect, test } from '@playwright/test'

test('has title', async ({ page }) => {
await page.goto('http://localhost:5173/')
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@
"@vitejs/plugin-react-swc": "3.5.0",
"@vitest/coverage-v8": "0.34.6",
"autoprefixer": "10.4.16",
"daisyui": "3.9.3",
"daisyui": "4.4.2",
"eslint": "8.54.0",
"eslint-config-prettier": "9.0.0",
"eslint-import-resolver-typescript": "3.6.1",
"eslint-plugin-import": "2.29.0",
"eslint-plugin-jest": "27.6.0",
"eslint-plugin-jest-dom": "5.1.0",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-node-import": "1.0.4",
"eslint-plugin-react": "7.33.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-react-refresh": "0.4.4",
"eslint-plugin-simple-import-sort": "10.0.0",
"eslint-plugin-testing-library": "6.1.2",
"gitzy": "4.0.0",
"jsdom": "22.1.0",
Expand Down
51 changes: 39 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import typeScriptLogo from './assets/typescript.svg'
import viteLogo from './assets/vite.svg'
import { Logo } from './components/Logo'

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

return (
<div className='container prose mx-auto p-4 text-center'>
<div className='container prose dsy-prose mx-auto p-4 text-center'>
<div className='mb-8 flex items-center justify-center gap-8'>
<Logo name='Vite' link='https://vitejs.dev' imgSrc={viteLogo} />
<Logo name='React' link='https://react.dev' imgSrc={reactLogo} />
Expand All @@ -28,7 +28,7 @@ function App() {
<h1>Vite + React + TypeScript + tailwindcss</h1>
<div>
<button
className='btn'
className='dsy-btn'
onClick={() => {
setCount((prevCount) => prevCount + 1)
}}
Expand All @@ -52,5 +52,3 @@ function App() {
</div>
)
}

export default App
9 changes: 5 additions & 4 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import React from 'react'
import './index.css'

import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'

import App from './App'
import './index.css'

const root = document.getElementById('root')

if (root) {
createRoot(root).render(
<React.StrictMode>
<StrictMode>
<App />
</React.StrictMode>
</StrictMode>
)
}
2 changes: 1 addition & 1 deletion src/test/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ const customRender = (ui: React.ReactElement, options = {}) => {
}
}

export { screen, renderHook, within } from '@testing-library/react'
export { renderHook, screen, within } from '@testing-library/react'
export { customRender as render }
1 change: 1 addition & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
daisyui: {
// see https://daisyui.com/docs/themes/ for further customization
themes: ['dark'],
prefix: 'dsy-',
logs: false,
},
plugins: [typography, daisyui],
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from 'path'
import path from 'node:path'

import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
Expand Down