Skip to content

Commit

Permalink
Add strict @typescript-eslint rules (MINOR)
Browse files Browse the repository at this point in the history
  • Loading branch information
will-molloy committed Jun 27, 2024
1 parent 6353e3b commit 5569549
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 63 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module.exports = {
'plugin:import/recommended',
'plugin:jsx-a11y/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
plugins: [
'react',
Expand Down
124 changes: 62 additions & 62 deletions pnpm-lock.yaml

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

8 changes: 7 additions & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ const App = () => {
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
<button
onClick={() => {
setCount((count) => count + 1);
}}
>
count is {count}
</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
Expand Down
1 change: 1 addition & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ReactDOM from 'react-dom/client';
import App from './components/App.tsx';
import './index.css';

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
Expand Down

0 comments on commit 5569549

Please sign in to comment.