Skip to content
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: 5 additions & 0 deletions t29-project-1/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# Environment variables
.env
.env.*
!.env.example
5 changes: 2 additions & 3 deletions t29-project-1/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

#!/usr/bin/env sh
cd -- "$(dirname -- "$0")/.." || exit 1
npx lint-staged
10 changes: 4 additions & 6 deletions t29-project-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ export default defineConfig([
// other options...
},
},
])

]);
```

You can also install [eslint-plugin-react-x](https://npmx.dev/package/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://npmx.dev/package/eslint-plugin-react-dom) for React-specific lint rules:

```js
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
import reactX from 'eslint-plugin-react-x';
import reactDom from 'eslint-plugin-react-dom';

export default defineConfig([
globalIgnores(['dist']),
Expand All @@ -70,6 +69,5 @@ export default defineConfig([
// other options...
},
},
])

]);
```
23 changes: 16 additions & 7 deletions t29-project-1/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
import js from '@eslint/js';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import tseslint from 'typescript-eslint';
import { defineConfig, globalIgnores } from 'eslint/config';

export default defineConfig([
globalIgnores(['dist']),
Expand All @@ -19,4 +19,13 @@ export default defineConfig([
globals: globals.browser,
},
},
])
{
// Plain JS files (e.g. server/**/*.js, root config files) run under Node, not the browser.
files: ['**/*.{js,cjs,mjs}'],
extends: [js.configs.recommended],
languageOptions: {
globals: globals.node,
sourceType: 'module',
},
},
]);
30 changes: 0 additions & 30 deletions t29-project-1/package-lock.json

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

10 changes: 5 additions & 5 deletions t29-project-1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"format": "prettier --write \"src/**/*.{js,ts,tsx,jsx,json,css,md}\"",
"prettier:check": "prettier --check \"src/**/*.{js,ts,tsx,jsx,json,css,md}\"",
"prepare": "husky install"
"format": "prettier --write .",
"prettier:check": "prettier --check .",
"prepare": "cd .. && husky t29-project-1/.husky"
},
"lint-staged": {
"src/**/*.{js,ts,tsx,jsx}": [
"**/*.{js,ts,tsx,jsx}": [
"eslint --fix",
"prettier --write"
],
"src/**/*.{json,css,md}": [
"**/*.{json,css,md}": [
"prettier --write"
]
},
Expand Down
16 changes: 8 additions & 8 deletions t29-project-1/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'react'
import heroImg from './assets/hero.png'
import reactLogo from './assets/react.svg'
import viteLogo from './assets/vite.svg'
import './App.css'
import { useState } from 'react';
import heroImg from './assets/hero.png';
import reactLogo from './assets/react.svg';
import viteLogo from './assets/vite.svg';
import './App.css';

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

return (
<>
Expand Down Expand Up @@ -116,7 +116,7 @@ function App() {
<div className="ticks"></div>
<section id="spacer"></section>
</>
)
);
}

export default App
export default App;
12 changes: 6 additions & 6 deletions t29-project-1/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App.tsx';

createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)
</StrictMode>
);
6 changes: 3 additions & 3 deletions t29-project-1/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';

// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
})
});