Compare commits

..

4 Commits

Author SHA1 Message Date
5e626a4afb delete lock 2024-10-10 21:39:56 -04:00
1349c7c430 format :) 2024-10-10 20:00:22 -04:00
8c1f86a857 Merge branch 'master' into feature/prettier 2024-09-30 10:42:13 -04:00
21d6ce423b prettier aded 2024-09-30 10:13:11 -04:00
7 changed files with 40 additions and 8 deletions

2
.prettierignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
dist

6
.prettierrc Normal file
View File

@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80,
"semi": false
}

View File

@ -4,11 +4,16 @@ import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks' import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh' import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint' import tseslint from 'typescript-eslint'
import prettierPlugin from 'eslint-plugin-prettier'
export default tseslint.config( export default tseslint.config(
{ ignores: ['dist'] }, { ignores: ['dist'] },
{ {
extends: [js.configs.recommended, ...tseslint.configs.recommendedTypeChecked], extends: [
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
'plugin:prettier/recommended',
],
files: ['**/*.{ts,tsx}'], files: ['**/*.{ts,tsx}'],
languageOptions: { languageOptions: {
ecmaVersion: 2020, ecmaVersion: 2020,
@ -16,15 +21,23 @@ export default tseslint.config(
parserOptions: { parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'], project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname, tsconfigRootDir: import.meta.dirname,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
}, },
}, },
settings: { react: { version: '18.3' } }, settings: { react: { version: '18.3' } },
plugins: { plugins: {
prettier: prettierPlugin,
react, react,
'react-hooks': reactHooks, 'react-hooks': reactHooks,
'react-refresh': reactRefresh, 'react-refresh': reactRefresh,
}, },
rules: { rules: {
'prettier/prettier': 'error',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
...reactHooks.configs.recommended.rules, ...reactHooks.configs.recommended.rules,
...react.configs.recommended.rules, ...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules, ...react.configs['jsx-runtime'].rules,

View File

@ -7,6 +7,7 @@
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"lint": "eslint .", "lint": "eslint .",
"format": "prettier --write .",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
@ -19,10 +20,13 @@
"@types/react-dom": "^18.3.0", "@types/react-dom": "^18.3.0",
"@vitejs/plugin-react-swc": "^3.5.0", "@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^9.9.0", "eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.0", "eslint-plugin-react": "^7.37.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0", "eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9", "eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0", "globals": "^15.9.0",
"prettier": "^3.3.3",
"typescript": "^5.5.3", "typescript": "^5.5.3",
"typescript-eslint": "^8.0.1", "typescript-eslint": "^8.0.1",
"vite": "^5.4.1" "vite": "^5.4.1"

View File

@ -2,7 +2,9 @@ import React from 'react'
export default function App() { export default function App() {
const [count, setCount] = React.useState(0) const [count, setCount] = React.useState(0)
return <button onClick={() => setCount((count) => count + 1)}> return (
<button onClick={() => setCount((count) => count + 1)}>
count is {count} count is {count}
</button>; </button>
)
} }

View File

@ -1,6 +1,11 @@
import React from 'react' import React from 'react'
import ReactDOM from 'react-dom/client' import ReactDOM from 'react-dom/client'
import App from './App'; import App from './App'
const root = document.getElementById('root'); const root = document.getElementById('root')
root && ReactDOM.createRoot(root).render(<React.StrictMode><App /></React.StrictMode>); root &&
ReactDOM.createRoot(root).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)

View File

@ -20,5 +20,5 @@
"types": ["vite/client"] "types": ["vite/client"]
}, },
"include": ["vite.config.ts"], "include": ["vite.config.ts"]
} }